2
0

json.go 571 B

1234567891011121314151617181920212223
  1. package json
  2. import (
  3. "encoding/json"
  4. gojson "github.com/goccy/go-json"
  5. jsoniter "github.com/json-iterator/go"
  6. )
  7. // Marshal leverages the go-json library for Marshalling JSON. This avoids a recursive
  8. // loop that occurs on marshal errors in json-iterator.
  9. var Marshal = gojson.Marshal
  10. // Unmarshal leverages the json-iterator library for Unmarshalling JSON.
  11. var Unmarshal = jsoniter.Unmarshal
  12. var NewEncoder = json.NewEncoder
  13. var NewDecoder = json.NewDecoder
  14. type Marshaler = json.Marshaler
  15. type Unmarshaler = json.Unmarshaler
  16. type RawMessage = json.RawMessage