ToStringSliceE: Support string values

This commit is contained in:
Chance Zibolski 2015-02-18 18:44:31 -08:00
parent 2318c5caf2
commit 401c6a67e5
1 changed files with 3 additions and 0 deletions

View File

@ -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)
}