From 4c564207c6c8f463c73bd642952353ef6cdbf7f2 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Thu, 17 Jan 2019 13:07:40 +0530 Subject: [PATCH] Fix error checking issue in json Decode Signed-off-by: Madhu Rajanna --- pkg/cephfs/cephuser.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/cephfs/cephuser.go b/pkg/cephfs/cephuser.go index 340a8dbec..fda2a5e6b 100644 --- a/pkg/cephfs/cephuser.go +++ b/pkg/cephfs/cephuser.go @@ -69,7 +69,7 @@ func getCephUser(adminCr *credentials, volID volumeID) (*cephEntity, error) { // Contains non-json data: "exported keyring for ENTITY\n\n" offset := bytes.Index(out, []byte("[{")) - if json.NewDecoder(bytes.NewReader(out[offset:])).Decode(&ents); err != nil { + if err = json.NewDecoder(bytes.NewReader(out[offset:])).Decode(&ents); err != nil { return nil, fmt.Errorf("failed to decode json: %v", err) }