...

Source file src/github.com/hashicorp/go-multierror/sort.go

Documentation: github.com/hashicorp/go-multierror

     1  package multierror
     2  
     3  // Len implements sort.Interface function for length
     4  func (err Error) Len() int {
     5  	return len(err.Errors)
     6  }
     7  
     8  // Swap implements sort.Interface function for swapping elements
     9  func (err Error) Swap(i, j int) {
    10  	err.Errors[i], err.Errors[j] = err.Errors[j], err.Errors[i]
    11  }
    12  
    13  // Less implements sort.Interface function for determining order
    14  func (err Error) Less(i, j int) bool {
    15  	return err.Errors[i].Error() < err.Errors[j].Error()
    16  }
    17  

View as plain text