Files
jira/jiradata/ErrorCollectionFuncs.go
T
2017-08-27 19:41:49 -07:00

19 lines
349 B
Go

package jiradata
import "strings"
// Error is needed to make ErrorCollection implement the error interface
func (e ErrorCollection) Error() string {
if len(e.ErrorMessages) > 0 {
return strings.Join(e.ErrorMessages, ". ")
}
out := ""
for k, v := range e.Errors {
if len(out) > 0 {
out += ". "
}
out += k + ": " + v
}
return out
}