diff --git a/rados/rados_test.go b/rados/rados_test.go index fca3ef6..270d8ef 100644 --- a/rados/rados_test.go +++ b/rados/rados_test.go @@ -1175,7 +1175,9 @@ func (suite *RadosTestSuite) TestGetLastVersion() { ioctx, err := suite.conn.OpenIOContext(suite.pool) require.NoError(suite.T(), err) oid := suite.GenObjectName() - defer suite.ioctx.Delete(oid) + defer func(oid string) { + assert.NoError(t, ioctx.Delete(oid)) + }(oid) v1, _ := ioctx.GetLastVersion() @@ -1201,7 +1203,9 @@ func (suite *RadosTestSuite) TestGetLastVersion() { ioctx, err := suite.conn.OpenIOContext(suite.pool) require.NoError(suite.T(), err) oid := suite.GenObjectName() - defer ioctx.Delete(oid) + defer func(oid string) { + assert.NoError(t, ioctx.Delete(oid)) + }(oid) v1, _ := ioctx.GetLastVersion() @@ -1241,7 +1245,9 @@ func (suite *RadosTestSuite) TestGetLastVersion() { vers := make([]uint64, 5) for i := 0; i < 5; i++ { oid := suite.GenObjectName() - defer ioctx.Delete(oid) + defer func(oid string) { + assert.NoError(t, ioctx.Delete(oid)) + }(oid) err = ioctx.Write(oid, []byte(oid), 0) assert.NoError(t, err) diff --git a/rados/read_op_test.go b/rados/read_op_test.go index e9e319f..b8ff778 100644 --- a/rados/read_op_test.go +++ b/rados/read_op_test.go @@ -30,7 +30,7 @@ func (suite *RadosTestSuite) TestReadOpAssertExists() { // ensure a nil ioctx triggers a panic assert.Panics(suite.T(), func() { - op2.Operate(nil, "foo", OperationNoFlag) + _ = op2.Operate(nil, "foo", OperationNoFlag) }) } diff --git a/rados/snapshot_test.go b/rados/snapshot_test.go index 4c73786..f0e8884 100644 --- a/rados/snapshot_test.go +++ b/rados/snapshot_test.go @@ -195,7 +195,6 @@ func (suite *RadosTestSuite) TestRollbackSnapshot() { ioctx, err := suite.conn.OpenIOContext(suite.pool) require.NoError(suite.T(), err) oid := suite.GenObjectName() - defer suite.ioctx.Delete(oid) err = ioctx.RollbackSnap(oid, "someName") assert.Error(t, err) @@ -220,7 +219,9 @@ func (suite *RadosTestSuite) TestRollbackSnapshot() { ioctx, err := suite.conn.OpenIOContext(suite.pool) require.NoError(suite.T(), err) oid := suite.GenObjectName() - defer suite.ioctx.Delete(oid) + defer func(oid string) { + assert.NoError(t, ioctx.Delete(oid)) + }(oid) bytesIn := []byte("Harry Potter") err = suite.ioctx.Write(oid, bytesIn, 0) diff --git a/rados/write_op_test.go b/rados/write_op_test.go index 3a58a58..6fd8dc0 100644 --- a/rados/write_op_test.go +++ b/rados/write_op_test.go @@ -31,7 +31,7 @@ func (suite *RadosTestSuite) TestWriteOpCreate() { assert.Panics(suite.T(), func() { op := CreateWriteOp() defer op.Release() - op.Operate(nil, "foo", OperationNoFlag) + _ = op.Operate(nil, "foo", OperationNoFlag) }) }