File: errors.go

package info (click to toggle)
golang-github-mitchellh-hashstructure-v2 2.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 112 kB
  • sloc: makefile: 2
file content (22 lines) | stat: -rw-r--r-- 592 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package hashstructure

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("hashstructure: %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 hashstructure library"
}