Explorar el Código

统一优化JSON报文的日志输出

niujiuru hace 1 mes
padre
commit
8b8d1f51ac
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      utils/utils.go

+ 1 - 1
utils/utils.go

@@ -232,7 +232,7 @@ func CountJSONRecords(filePath string) (int, error) {
 
 func FormatJSON(data []byte) string {
 	var buf bytes.Buffer
-	if json.Indent(&buf, data, "", "  ") != nil {
+	if json.Compact(&buf, data) != nil {
 		return string(data)
 	}
 	return buf.String()