summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/hashicorp/go-multierror/sort.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2018-07-22 20:14:05 -0700
committerGitHub <noreply@github.com>2018-07-22 20:14:05 -0700
commitbac3376278bfd8125879ca86e8eb26df85858d4c (patch)
tree8dec71c9deadf8c2138998a3cb6e93b3fec1c380 /vendor/github.com/hashicorp/go-multierror/sort.go
parent3539a9a60b24bd9c0c1360b17c8fe3e6ebf8cf3c (diff)
downloadchat-bac3376278bfd8125879ca86e8eb26df85858d4c.tar.gz
chat-bac3376278bfd8125879ca86e8eb26df85858d4c.tar.bz2
chat-bac3376278bfd8125879ca86e8eb26df85858d4c.zip
Updating dependencies (#9139)
Diffstat (limited to 'vendor/github.com/hashicorp/go-multierror/sort.go')
-rw-r--r--vendor/github.com/hashicorp/go-multierror/sort.go16
1 files changed, 16 insertions, 0 deletions
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()
+}