diff --git a/common/go.mod b/common/go.mod index 8c734fe160..932afb2fa4 100644 --- a/common/go.mod +++ b/common/go.mod @@ -16,6 +16,7 @@ require ( github.com/gorilla/mux v1.8.0 // indirect github.com/hashicorp/go-multierror v1.1.1 github.com/jinzhu/copier v0.3.2 + github.com/json-iterator/go v1.1.12 github.com/mitchellh/mapstructure v1.4.2 github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 // indirect github.com/onsi/ginkgo v1.16.4 diff --git a/common/go.sum b/common/go.sum index 6e900b75a6..f8e4d19a78 100644 --- a/common/go.sum +++ b/common/go.sum @@ -495,6 +495,8 @@ github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= @@ -580,6 +582,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= diff --git a/common/libimage/copier.go b/common/libimage/copier.go index 636b97bfde..4f5c7d0a16 100644 --- a/common/libimage/copier.go +++ b/common/libimage/copier.go @@ -2,7 +2,6 @@ package libimage import ( "context" - "encoding/json" "io" "os" "strings" diff --git a/common/libimage/corrupted_test.go b/common/libimage/corrupted_test.go index 6140728378..ace2d2640e 100644 --- a/common/libimage/corrupted_test.go +++ b/common/libimage/corrupted_test.go @@ -2,7 +2,6 @@ package libimage import ( "context" - "encoding/json" "io/ioutil" "os" "path/filepath" diff --git a/common/libimage/image_config.go b/common/libimage/image_config.go index b571211829..1402024405 100644 --- a/common/libimage/image_config.go +++ b/common/libimage/image_config.go @@ -1,7 +1,6 @@ package libimage import ( - "encoding/json" "fmt" "path/filepath" "strconv" diff --git a/common/libimage/inspect.go b/common/libimage/inspect.go index 3497091551..a872e5cf9d 100644 --- a/common/libimage/inspect.go +++ b/common/libimage/inspect.go @@ -2,7 +2,6 @@ package libimage import ( "context" - "encoding/json" "time" "github.com/containers/image/v5/manifest" diff --git a/common/libimage/runtime.go b/common/libimage/runtime.go index dabadbec0e..7f25df2005 100644 --- a/common/libimage/runtime.go +++ b/common/libimage/runtime.go @@ -13,10 +13,14 @@ import ( "github.com/containers/image/v5/types" "github.com/containers/storage" deepcopy "github.com/jinzhu/copier" + jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" "github.com/sirupsen/logrus" ) +// Faster than the standard library, see https://github.com/json-iterator/go. +var json = jsoniter.ConfigCompatibleWithStandardLibrary + // RuntimeOptions allow for creating a customized Runtime. type RuntimeOptions struct { // The base system context of the runtime which will be used throughout diff --git a/common/vendor/modules.txt b/common/vendor/modules.txt index 575b548d42..36bc25a73a 100644 --- a/common/vendor/modules.txt +++ b/common/vendor/modules.txt @@ -260,6 +260,7 @@ github.com/inconshreveable/mousetrap ## explicit github.com/jinzhu/copier # github.com/json-iterator/go v1.1.11 +## explicit github.com/json-iterator/go # github.com/juju/ansiterm v0.0.0-20180109212912-720a0952cc2a github.com/juju/ansiterm