rbd: check that encode calls dont return error

Don't ignore the error returned by json encode func call.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
John Mulligan 2020-04-08 16:36:57 -04:00 committed by John Mulligan
parent 8ce5fa5fc7
commit 0faccb56e8

View File

@ -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)