diff options
Diffstat (limited to 'int_slice.go')
| -rw-r--r-- | int_slice.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/int_slice.go b/int_slice.go index 69e7e7c..b28353d 100644 --- a/int_slice.go +++ b/int_slice.go @@ -43,6 +43,10 @@ func (s *intSliceValue) String() string { func intSliceConv(val string) (interface{}, error) { val = strings.Trim(val, "[]") + // Empty string would cause a slice with one (empty) entry + if len(val) == 0 { + return []int{}, nil + } ss := strings.Split(val, ",") out := make([]int, len(ss)) for i, d := range ss { |
