feat: added handler to convert an error slice to string slice
This commit is contained in:
vanhempi
e38d93ddee
commit
2e0cffc044
5
caste.go
5
caste.go
@ -1131,6 +1131,11 @@ func ToStringSliceE(i interface{}) ([]string, error) {
|
||||
return v, nil
|
||||
case string:
|
||||
return strings.Fields(v), nil
|
||||
case []error:
|
||||
for _, err := range i.([]error) {
|
||||
a = append(a, err.Error())
|
||||
}
|
||||
return a, nil
|
||||
case interface{}:
|
||||
str, err := ToStringE(v)
|
||||
if err != nil {
|
||||
|
Ladataan…
Viittaa uudesa ongelmassa
Block a user