diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-04-21 16:13:06 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-21 16:13:06 -0400 |
commit | ba1b5d4559d336b5d52d961eb273f6fe40c50d8f (patch) | |
tree | 765af64fae0f2c3156178e5c71d6d2cb19f1d111 /cmd/podman/registry/json.go | |
parent | 02bd8cef7b7286f8955a68a00294c08d81803a4a (diff) | |
parent | b21a5b7ff470612e2bde5f120aecfbc1a0881689 (diff) | |
download | podman-ba1b5d4559d336b5d52d961eb273f6fe40c50d8f.tar.gz podman-ba1b5d4559d336b5d52d961eb273f6fe40c50d8f.tar.bz2 podman-ba1b5d4559d336b5d52d961eb273f6fe40c50d8f.zip |
Merge pull request #5851 from jwhonce/wip/json
Provide a json variable pointing to a configured json API
Diffstat (limited to 'cmd/podman/registry/json.go')
-rw-r--r-- | cmd/podman/registry/json.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/cmd/podman/registry/json.go b/cmd/podman/registry/json.go new file mode 100644 index 000000000..f25406c3c --- /dev/null +++ b/cmd/podman/registry/json.go @@ -0,0 +1,20 @@ +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 +} |