aboutsummaryrefslogtreecommitdiff
path: root/vendor/github.com/hashicorp/go-multierror/sort.go
diff options
context:
space:
mode:
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 0000000..fecb14e
--- /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()
+}