Use strings.Fields
This commit is contained in:
parent
b24b4ff690
commit
dace11d497
2
caste.go
2
caste.go
@ -294,7 +294,7 @@ func ToStringSliceE(i interface{}) ([]string, error) {
|
|||||||
case []string:
|
case []string:
|
||||||
return v, nil
|
return v, nil
|
||||||
case string:
|
case string:
|
||||||
return strings.Split(v, " "), nil
|
return strings.Fields(v), nil
|
||||||
default:
|
default:
|
||||||
return a, fmt.Errorf("Unable to Cast %#v to []string", i)
|
return a, fmt.Errorf("Unable to Cast %#v to []string", i)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user