use jsoniter for json marshal/unmarshal in KMS (#12146)

Signed-off-by: Harshavardhana <harsha@minio.io>
This commit is contained in:
Harshavardhana
2021-04-26 16:01:52 -07:00
committed by GitHub
parent d501c5e38b
commit 2966823818
3 changed files with 7 additions and 2 deletions

View File

@@ -20,6 +20,8 @@ package kms
import (
"encoding"
"encoding/json"
jsoniter "github.com/json-iterator/go"
)
// KMS is the generic interface that abstracts over
@@ -106,6 +108,7 @@ func (d *DEK) UnmarshalText(text []byte) error {
Ciphertext []byte `json:"ciphertext"`
}
var v JSON
var json = jsoniter.ConfigCompatibleWithStandardLibrary
if err := json.Unmarshal(text, &v); err != nil {
return err
}