forked from TrueCloudLab/frostfs-api-go
[#199] sdk/object: Correct linter's remarks
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
3a966ee5df
commit
1ff8b3fd94
2 changed files with 8 additions and 2 deletions
|
@ -10,6 +10,10 @@ import (
|
|||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
var errCheckSumMismatch = errors.New("payload checksum mismatch")
|
||||
|
||||
var errIncorrectID = errors.New("incorrect object identifier")
|
||||
|
||||
// CalculatePayloadChecksum calculates and returns checksum of
|
||||
// object payload bytes.
|
||||
func CalculatePayloadChecksum(payload []byte) *pkg.Checksum {
|
||||
|
@ -34,7 +38,7 @@ func VerifyPayloadChecksum(obj *Object) error {
|
|||
obj.PayloadChecksum(),
|
||||
CalculatePayloadChecksum(obj.Payload()),
|
||||
) {
|
||||
return errors.New("payload checksum mismatch")
|
||||
return errCheckSumMismatch
|
||||
}
|
||||
|
||||
return nil
|
||||
|
@ -75,7 +79,7 @@ func VerifyID(obj *Object) error {
|
|||
}
|
||||
|
||||
if !id.Equal(obj.ID()) {
|
||||
return errors.New("incorrect object identifier")
|
||||
return errIncorrectID
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue