Use standard library for JSON encoding

This commit is contained in:
2019-11-03 01:56:42 +09:00
parent 7f4534f03e
commit 9d97be7c15
6 changed files with 15 additions and 12 deletions

View File

@ -1,12 +1,12 @@
package stringutils
import (
"encoding/json"
"fmt"
"strings"
"unicode"
"unicode/utf8"
jsoniter "github.com/json-iterator/go"
"github.com/xrash/smetrics"
)
@ -97,7 +97,7 @@ func PrettyPrint(obj interface{}) {
// Currently, MarshalIndent doesn't support tabs.
// Change this back to using \t when it's implemented.
// See: https://github.com/json-iterator/go/pull/273
pretty, _ := jsoniter.MarshalIndent(obj, "", " ")
pretty, _ := json.MarshalIndent(obj, "", " ")
fmt.Println(string(pretty))
}