feat: added handler to convert an error slice to string slice

This commit is contained in:
PacoDw 2019-10-23 14:16:23 -05:00
parent e38d93ddee
commit 2e0cffc044

View File

@ -1131,6 +1131,11 @@ func ToStringSliceE(i interface{}) ([]string, error) {
return v, nil return v, nil
case string: case string:
return strings.Fields(v), nil return strings.Fields(v), nil
case []error:
for _, err := range i.([]error) {
a = append(a, err.Error())
}
return a, nil
case interface{}: case interface{}:
str, err := ToStringE(v) str, err := ToStringE(v)
if err != nil { if err != nil {