generated from ZEISS/template-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
75c76d9
commit b6717c6
Showing
3 changed files
with
493 additions
and
0 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,22 @@ | ||
package hash | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
// ErrNotStringer is returned when there's an error with hash:"string" | ||
type ErrNotStringer struct { | ||
Field string | ||
} | ||
|
||
// Error implements error for ErrNotStringer | ||
func (ens *ErrNotStringer) Error() string { | ||
return fmt.Sprintf("hash: %s has hash:\"string\" set, but does not implement fmt.Stringer", ens.Field) | ||
} | ||
|
||
// ErrFormat is returned when an invalid format is given to the Hash function. | ||
type ErrFormat struct{} | ||
|
||
func (*ErrFormat) Error() string { | ||
return "format must be one of the defined Format values in the hash library" | ||
} |
Oops, something went wrong.