ToStringSliceE: Support string values
This commit is contained in:
parent
9590eb1aa4
commit
5529b218a4
3
caste.go
3
caste.go
@ -11,6 +11,7 @@ import (
|
||||
"html/template"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
jww "github.com/spf13/jwalterweatherman"
|
||||
@ -292,6 +293,8 @@ func ToStringSliceE(i interface{}) ([]string, error) {
|
||||
return a, nil
|
||||
case []string:
|
||||
return v, nil
|
||||
case string:
|
||||
return strings.Split(v, " "), nil
|
||||
default:
|
||||
return a, fmt.Errorf("Unable to Cast %#v to []string", i)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user