github.com/noxiouz/docker@v0.7.3-0.20160629055221-3d231c78e8c5/cli/error.go (about) 1 package cli 2 3 import "strings" 4 5 // Errors is a list of errors. 6 // Useful in a loop if you don't want to return the error right away and you want to display after the loop, 7 // all the errors that happened during the loop. 8 type Errors []error 9 10 func (errList Errors) Error() string { 11 if len(errList) < 1 { 12 return "" 13 } 14 15 out := make([]string, len(errList)) 16 for i := range errList { 17 out[i] = errList[i].Error() 18 } 19 return strings.Join(out, ", ") 20 }