mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
cleanup: address err113 warnings about direct error comparisons
Several places in the code compared errors directly with the go-ceph sentinel errors. This change uses the errors.Is() function of go 1.13 instead. The err113 linter reported this issue as: err113: do not compare errors directly, use errors.Is() instead Signed-off-by: Sven Anderson <sven@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
7affb9289d
commit
de74c36d8c
@ -73,7 +73,7 @@ func (cc *ClusterConnection) GetIoctx(pool string) (*rados.IOContext, error) {
|
||||
ioctx, err := cc.conn.OpenIOContext(pool)
|
||||
if err != nil {
|
||||
// ErrNotFound indicates the Pool was not found
|
||||
if err == rados.ErrNotFound {
|
||||
if errors.Is(err, rados.ErrNotFound) {
|
||||
err = ErrPoolNotFound{pool, err}
|
||||
} else {
|
||||
err = fmt.Errorf("failed to open IOContext for pool %s: %w", pool, err)
|
||||
|
Reference in New Issue
Block a user