[#199] sdk/object: Correct linter's remarks

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2020-11-16 17:54:43 +03:00 committed by Alex Vanin
parent 3a966ee5df
commit 1ff8b3fd94
2 changed files with 8 additions and 2 deletions

View file

@ -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