Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
projectdiscovery
GitHub Repository: projectdiscovery/nuclei
Path: blob/dev/pkg/utils/json/json.go
2070 views
1
//go:build (linux || darwin || windows) && (amd64 || arm64)
2
// +build linux darwin windows
3
// +build amd64 arm64
4
5
package json
6
7
import "github.com/bytedance/sonic"
8
9
var api = sonic.ConfigStd
10
11
// Exported functions from the [sonic.API].
12
var (
13
Marshal = api.Marshal
14
Unmarshal = api.Unmarshal
15
MarshalIndent = api.MarshalIndent
16
NewDecoder = api.NewDecoder
17
NewEncoder = api.NewEncoder
18
)
19
20
// Encoder is a JSON encoder.
21
type Encoder = sonic.Encoder
22
23
// Decoder is a JSON decoder.
24
type Decoder = sonic.Decoder
25
26
// SetConfig sets the configuration for the JSON package.
27
func SetConfig(config *sonic.Config) {
28
api = config.Froze()
29
}
30
31