123456789101112131415161718 |
- // 设置jsoniter为默认库 // +build jsoniter // 仅当编译时带 -tags=jsoniter 参数时才生效
- package jsonutil
- import (
- "github.com/json-iterator/go"
- )
- var (
- json = jsoniter.ConfigCompatibleWithStandardLibrary
- Marshal = json.Marshal
- Unmarshal = json.Unmarshal
- MarshalToString = json.MarshalToString
- UnmarshalFromString = json.UnmarshalFromString
- MarshalIndent = json.MarshalIndent
- NewDecoder = json.NewDecoder
- NewEncoder = json.NewEncoder
- )
|