errors.go 592 B

12345678910111213141516171819202122
  1. package hashstructure
  2. import (
  3. "fmt"
  4. )
  5. // ErrNotStringer is returned when there's an error with hash:"string"
  6. type ErrNotStringer struct {
  7. Field string
  8. }
  9. // Error implements error for ErrNotStringer
  10. func (ens *ErrNotStringer) Error() string {
  11. return fmt.Sprintf("hashstructure: %s has hash:\"string\" set, but does not implement fmt.Stringer", ens.Field)
  12. }
  13. // ErrFormat is returned when an invalid format is given to the Hash function.
  14. type ErrFormat struct{}
  15. func (*ErrFormat) Error() string {
  16. return "format must be one of the defined Format values in the hashstructure library"
  17. }