mirror of
https://github.com/podman-container-tools/podman.git
synced 2026-10-17 11:27:33 +00:00
* All commands now using the same instance of json API * `json` variable created in each package to prevent `encoding/json` from being re-introduced Signed-off-by: Jhon Honce <jhonce@redhat.com>
20 lines
317 B
Go
20 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
|
|
}
|