生成代码,逐步进行优化

This commit is contained in:
2021-06-05 02:18:56 +08:00
parent 6aa2b74840
commit 79453d4d2a
10 changed files with 139 additions and 270 deletions
+4 -1
View File
@@ -1,6 +1,7 @@
package common
import (
"bytes"
"encoding/json"
"errors"
"math"
@@ -258,8 +259,10 @@ func ObjToStr(obj interface{}) string {
str = strconv.FormatFloat(obj.(float64), 'f', -1, 64)
default:
strbte, err := json.Marshal(obj)
var configByte bytes.Buffer
err = json.Indent(&configByte, strbte, "", "\t")
if err == nil {
str = string(strbte)
str = configByte.String()
}
}