Skip to content

Commit

Permalink
client: Replace ugorji/codec with json-iterator/go
Browse files Browse the repository at this point in the history
We need to use the stdlib-compatible one that is case-sensitive, etc

Change-Id: Id0df573a70e09967ac7d8c0a63d99d6a49ce82f1
  • Loading branch information
dims committed Apr 23, 2019
1 parent 216808e commit 6e6fc9c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions client/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"strings"
"time"

"github.com/ugorji/go/codec"
jsoniter "github.com/json-iterator/go"
"go.etcd.io/etcd/pkg/pathutil"
)

Expand Down Expand Up @@ -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
}
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down

0 comments on commit 6e6fc9c

Please sign in to comment.