Reimplement
This commit is contained in:
1 parent
d4d7c679aa
commit
df259e3f78
36 files changed
+559
-1135
No files matched your search
@@ -1,15 +1,14 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/tidwall/gjson"
|
||||
"io/ioutil"
|
||||
"isp-ctl/service"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/integration-system/isp-kit/json"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/tidwall/gjson"
|
||||
)
|
||||
|
||||
func CheckPath(pathObject string) (string, error) {
|
||||
@@ -47,14 +46,11 @@ func CheckChangeObject(changeObject string) (string, error) {
|
||||
}
|
||||
|
||||
func PrintAnswer(data interface{}) {
|
||||
buffer := bytes.NewBuffer(make([]byte, 0, 1024))
|
||||
encoder := json.NewEncoder(buffer)
|
||||
encoder := json.NewEncoder(os.Stdout)
|
||||
encoder.SetEscapeHTML(false)
|
||||
encoder.SetIndent("", " ")
|
||||
if err := encoder.Encode(data); err != nil {
|
||||
PrintError(err)
|
||||
} else {
|
||||
service.ColorService.Print(buffer.Bytes())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user