-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(errors): Use custom erorrs to allow
errors.Is()
(#19)
- Loading branch information
1 parent
f61e0ca
commit c70fcc9
Showing
3 changed files
with
24 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package gohashtree | ||
|
||
import "errors" | ||
|
||
var ( | ||
// ErrOddChunks is returned when the number of chunks is odd. | ||
ErrOddChunks = errors.New("odd number of chunks") | ||
// ErrNotEnoughDigests is returned when the number of digests is not enough. | ||
ErrNotEnoughDigests = errors.New("not enough digest length") | ||
// ErrChunksNotMultipleOf64 is returned when the chunks are not multiple of 64 bytes. | ||
ErrChunksNotMultipleOf64 = errors.New("chunks not multiple of 64 bytes") | ||
// ErrDigestsNotMultipleOf32 is returned when the digests are not multiple of 32 bytes. | ||
ErrDigestsNotMultipleOf32 = errors.New("digests not multiple of 32 bytes") | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters