From 0faccb56e8d345c16eb5b88e8e855dce5f34d9e5 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Wed, 8 Apr 2020 16:36:57 -0400 Subject: [PATCH] rbd: check that encode calls dont return error Don't ignore the error returned by json encode func call. Signed-off-by: John Mulligan --- rbd/rbd_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rbd/rbd_test.go b/rbd/rbd_test.go index 3e31919..bfd231e 100644 --- a/rbd/rbd_test.go +++ b/rbd/rbd_test.go @@ -535,7 +535,7 @@ func TestIOReaderWriter(t *testing.T) { assert.NoError(t, err) encoder := json.NewEncoder(img) - encoder.Encode(stats) + assert.NoError(t, encoder.Encode(stats)) err = img.Flush() assert.NoError(t, err) @@ -545,7 +545,7 @@ func TestIOReaderWriter(t *testing.T) { var stats2 *ImageInfo decoder := json.NewDecoder(img) - decoder.Decode(&stats2) + assert.NoError(t, decoder.Decode(&stats2)) assert.Equal(t, &stats, &stats2)