From 5529b218a49709fe8364608f8fbdca47a8e7f3bc Mon Sep 17 00:00:00 2001 From: Chance Zibolski Date: Wed, 18 Feb 2015 18:44:31 -0800 Subject: [PATCH] ToStringSliceE: Support string values --- caste.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/caste.go b/caste.go index d55b85b..36f6f91 100644 --- a/caste.go +++ b/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) }