Browse Source

client: Replace ugorji/codec with json-iterator/go

We need to use the stdlib-compatible one that is case-sensitive, etc

Change-Id: Id0df573a70e09967ac7d8c0a63d99d6a49ce82f1
Davanum Srinivas 6 years ago
parent
commit
69e0daf809
1 changed files with 3 additions and 2 deletions
  1. 3 2
      client/keys.go

+ 3 - 2
client/keys.go

@@ -28,7 +28,7 @@ import (
 	"time"
 
 	"github.com/coreos/etcd/pkg/pathutil"
-	"github.com/ugorji/go/codec"
+	jsoniter "github.com/json-iterator/go"
 )
 
 const (
@@ -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
 	}