crypto: improve error messages for base58
Golint: error strings should not be capitalized or end with punctuation or a newline Refs. #213.
This commit is contained in:
parent
89ed00ddfb
commit
a74518691c
1 changed files with 2 additions and 2 deletions
|
@ -96,11 +96,11 @@ func Base58CheckDecode(s string) (b []byte, err error) {
|
|||
}
|
||||
|
||||
if len(b) < 5 {
|
||||
return nil, errors.New("invalid base-58 check string: missing checksum.")
|
||||
return nil, errors.New("invalid base-58 check string: missing checksum")
|
||||
}
|
||||
|
||||
if !bytes.Equal(hash.Checksum(b[:len(b)-4]), b[len(b)-4:]) {
|
||||
return nil, errors.New("invalid base-58 check string: invalid checksum.")
|
||||
return nil, errors.New("invalid base-58 check string: invalid checksum")
|
||||
}
|
||||
|
||||
// Strip the 4 byte long hash.
|
||||
|
|
Loading…
Reference in a new issue