21 lines
317 B
Go
21 lines
317 B
Go
package registry
|
|
|
|
import (
|
|
"sync"
|
|
|
|
jsoniter "github.com/json-iterator/go"
|
|
)
|
|
|
|
var (
|
|
json jsoniter.API
|
|
jsonSync sync.Once
|
|
)
|
|
|
|
// JSONLibrary provides a "encoding/json" compatible API
|
|
func JSONLibrary() jsoniter.API {
|
|
jsonSync.Do(func() {
|
|
json = jsoniter.ConfigCompatibleWithStandardLibrary
|
|
})
|
|
return json
|
|
}
|