diff --git a/slice.go b/slice.go index e6a8328..221c551 100644 --- a/slice.go +++ b/slice.go @@ -89,8 +89,9 @@ func ToStringSliceE(i any) ([]string, error) { } var a []string + value, _ := indirect(i) - switch v := i.(type) { + switch v := value.(type) { case string: return strings.Fields(v), nil case any: diff --git a/slice_test.go b/slice_test.go index fb7597c..4f3e1af 100644 --- a/slice_test.go +++ b/slice_test.go @@ -244,6 +244,7 @@ func TestSlice(t *testing.T) { func TestStringSlice(t *testing.T) { testCases := []testCase{ + {"one\ttwo three", []string{"one", "two", "three"}, false}, {[]int{1, 2}, []string{"1", "2"}, false}, {[]int8{int8(1), int8(2)}, []string{"1", "2"}, false}, {[]int32{int32(1), int32(2)}, []string{"1", "2"}, false},