diff options
author | Christopher Speller <crspeller@gmail.com> | 2018-07-22 20:14:05 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-22 20:14:05 -0700 |
commit | bac3376278bfd8125879ca86e8eb26df85858d4c (patch) | |
tree | 8dec71c9deadf8c2138998a3cb6e93b3fec1c380 /vendor/github.com/hashicorp/go-multierror | |
parent | 3539a9a60b24bd9c0c1360b17c8fe3e6ebf8cf3c (diff) | |
download | chat-bac3376278bfd8125879ca86e8eb26df85858d4c.tar.gz chat-bac3376278bfd8125879ca86e8eb26df85858d4c.tar.bz2 chat-bac3376278bfd8125879ca86e8eb26df85858d4c.zip |
Updating dependencies (#9139)
Diffstat (limited to 'vendor/github.com/hashicorp/go-multierror')
-rw-r--r-- | vendor/github.com/hashicorp/go-multierror/format.go | 6 | ||||
-rw-r--r-- | vendor/github.com/hashicorp/go-multierror/sort.go | 16 |
2 files changed, 19 insertions, 3 deletions
diff --git a/vendor/github.com/hashicorp/go-multierror/format.go b/vendor/github.com/hashicorp/go-multierror/format.go index 6c7a3cc91..47f13c49a 100644 --- a/vendor/github.com/hashicorp/go-multierror/format.go +++ b/vendor/github.com/hashicorp/go-multierror/format.go @@ -13,7 +13,7 @@ type ErrorFormatFunc func([]error) string // that occurred along with a bullet point list of the errors. func ListFormatFunc(es []error) string { if len(es) == 1 { - return fmt.Sprintf("1 error occurred:\n\n* %s", es[0]) + return fmt.Sprintf("1 error occurred:\n\t* %s\n\n", es[0]) } points := make([]string, len(es)) @@ -22,6 +22,6 @@ func ListFormatFunc(es []error) string { } return fmt.Sprintf( - "%d errors occurred:\n\n%s", - len(es), strings.Join(points, "\n")) + "%d errors occurred:\n\t%s\n\n", + len(es), strings.Join(points, "\n\t")) } diff --git a/vendor/github.com/hashicorp/go-multierror/sort.go b/vendor/github.com/hashicorp/go-multierror/sort.go new file mode 100644 index 000000000..fecb14e81 --- /dev/null +++ b/vendor/github.com/hashicorp/go-multierror/sort.go @@ -0,0 +1,16 @@ +package multierror + +// Len implements sort.Interface function for length +func (err Error) Len() int { + return len(err.Errors) +} + +// Swap implements sort.Interface function for swapping elements +func (err Error) Swap(i, j int) { + err.Errors[i], err.Errors[j] = err.Errors[j], err.Errors[i] +} + +// Less implements sort.Interface function for determining order +func (err Error) Less(i, j int) bool { + return err.Errors[i].Error() < err.Errors[j].Error() +} |