Fix some of the linter exceptions #156

Merged
fyrchik merged 7 commits from fyrchik/frostfs-node:linter-fixes into master 2023-03-22 07:14:19 +00:00
Showing only changes of commit 60bcec0fcb - Show all commits

View file

@ -138,16 +138,20 @@ func objectLocked(tx *bbolt.Tx, idCnr cid.ID, idObj oid.ID) bool {
// Operation is very resource-intensive, which is caused by the admissibility // Operation is very resource-intensive, which is caused by the admissibility
// of multiple locks. Also, if we knew what objects are locked, it would be // of multiple locks. Also, if we knew what objects are locked, it would be
// possible to speed up the execution. // possible to speed up the execution.
//
// nolint: gocognit
func freePotentialLocks(tx *bbolt.Tx, idCnr cid.ID, locker oid.ID) error { func freePotentialLocks(tx *bbolt.Tx, idCnr cid.ID, locker oid.ID) error {
bucketLocked := tx.Bucket(bucketNameLocked) bucketLocked := tx.Bucket(bucketNameLocked)
if bucketLocked != nil { if bucketLocked == nil {
return nil
}
key := make([]byte, cidSize) key := make([]byte, cidSize)
idCnr.Encode(key) idCnr.Encode(key)
bucketLockedContainer := bucketLocked.Bucket(key) bucketLockedContainer := bucketLocked.Bucket(key)
if bucketLockedContainer != nil { if bucketLockedContainer == nil {
return nil
}
keyLocker := objectKey(locker, key) keyLocker := objectKey(locker, key)
return bucketLockedContainer.ForEach(func(k, v []byte) error { return bucketLockedContainer.ForEach(func(k, v []byte) error {
keyLockers, err := decodeList(v) keyLockers, err := decodeList(v)
@ -186,10 +190,6 @@ func freePotentialLocks(tx *bbolt.Tx, idCnr cid.ID, locker oid.ID) error {
return nil return nil
}) })
} }
}
return nil
}
// IsLockedPrm groups the parameters of IsLocked operation. // IsLockedPrm groups the parameters of IsLocked operation.
type IsLockedPrm struct { type IsLockedPrm struct {