mirror of
https://github.com/ceph/go-ceph
synced 2024-12-22 06:10:09 +00:00
rados: remove errcheck linter warnings
Signed-off-by: Sven Anderson <sven@redhat.com>
This commit is contained in:
parent
b7f01be284
commit
54fe45484a
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user