diff --git a/client/keys.go b/client/keys.go index 22874624183b..dd691fa86156 100644 --- a/client/keys.go +++ b/client/keys.go @@ -27,7 +27,7 @@ import ( "strings" "time" - "github.com/ugorji/go/codec" + jsoniter "github.com/json-iterator/go" "go.etcd.io/etcd/pkg/pathutil" ) @@ -658,7 +658,8 @@ func unmarshalHTTPResponse(code int, header http.Header, body []byte) (res *Resp func unmarshalSuccessfulKeysResponse(header http.Header, body []byte) (*Response, error) { var res Response - err := codec.NewDecoderBytes(body, new(codec.JsonHandle)).Decode(&res) + var json = jsoniter.ConfigCompatibleWithStandardLibrary + err := json.Unmarshal(body, &res) if err != nil { return nil, ErrInvalidJSON } diff --git a/go.mod b/go.mod index d3fef6a4ffb2..ce5bd2552281 100644 --- a/go.mod +++ b/go.mod @@ -23,6 +23,7 @@ require ( github.com/grpc-ecosystem/grpc-gateway v1.4.1 github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/jonboulle/clockwork v0.1.0 + github.com/json-iterator/go v1.1.5 // indirect github.com/kr/pty v1.0.0 github.com/mattn/go-colorable v0.0.9 // indirect github.com/mattn/go-isatty v0.0.4 // indirect diff --git a/go.sum b/go.sum index 9a5c3dc60f19..502b65cf609f 100644 --- a/go.sum +++ b/go.sum @@ -46,6 +46,7 @@ github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NH github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= +github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/kr/pty v1.0.0 h1:jR04h3bskdxb8xt+5B6MoxPwDhMCe0oEgxug4Ca1YSA= github.com/kr/pty v1.0.0/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4=