diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-04-22 03:48:32 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-22 03:48:32 -0400 |
commit | b46970763c3b1c75144c8d4acf8773f804035c8d (patch) | |
tree | 23e3b9423d905340a655f1e33d70599691d9cb34 /vendor/github.com/mitchellh/mapstructure/error.go | |
parent | 78ccd833906087d171f608d66a0384135dc80717 (diff) | |
parent | 17105028e519237b5dd310e32b2a334eaa41bb36 (diff) | |
download | podman-b46970763c3b1c75144c8d4acf8773f804035c8d.tar.gz podman-b46970763c3b1c75144c8d4acf8773f804035c8d.tar.bz2 podman-b46970763c3b1c75144c8d4acf8773f804035c8d.zip |
Merge pull request #13938 from rhatdan/VENDOR
Vendor
Diffstat (limited to 'vendor/github.com/mitchellh/mapstructure/error.go')
-rw-r--r-- | vendor/github.com/mitchellh/mapstructure/error.go | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/vendor/github.com/mitchellh/mapstructure/error.go b/vendor/github.com/mitchellh/mapstructure/error.go deleted file mode 100644 index 47a99e5af..000000000 --- a/vendor/github.com/mitchellh/mapstructure/error.go +++ /dev/null @@ -1,50 +0,0 @@ -package mapstructure - -import ( - "errors" - "fmt" - "sort" - "strings" -) - -// Error implements the error interface and can represents multiple -// errors that occur in the course of a single decode. -type Error struct { - Errors []string -} - -func (e *Error) Error() string { - points := make([]string, len(e.Errors)) - for i, err := range e.Errors { - points[i] = fmt.Sprintf("* %s", err) - } - - sort.Strings(points) - return fmt.Sprintf( - "%d error(s) decoding:\n\n%s", - len(e.Errors), strings.Join(points, "\n")) -} - -// WrappedErrors implements the errwrap.Wrapper interface to make this -// return value more useful with the errwrap and go-multierror libraries. -func (e *Error) WrappedErrors() []error { - if e == nil { - return nil - } - - result := make([]error, len(e.Errors)) - for i, e := range e.Errors { - result[i] = errors.New(e) - } - - return result -} - -func appendErrors(errors []string, err error) []string { - switch e := err.(type) { - case *Error: - return append(errors, e.Errors...) - default: - return append(errors, e.Error()) - } -} |