Merge pull request #2814 from satnam6502/list

Do not consider an empty string to be an error in list.go
This commit is contained in:
Joe Beda 2014-12-10 16:31:18 -08:00
commit 5523e0344a
2 changed files with 0 additions and 13 deletions

View File

@ -29,9 +29,6 @@ func (sl *StringList) String() string {
func (sl *StringList) Set(value string) error {
for _, s := range strings.Split(value, ",") {
if len(s) == 0 {
return fmt.Errorf("value should not be an empty string")
}
*sl = append(*sl, s)
}
return nil

View File

@ -30,13 +30,3 @@ func TestStringListSet(t *testing.T) {
t.Errorf("expected: %v, got: %v:", expected, sl)
}
}
func TestStringListSetErr(t *testing.T) {
var sl StringList
if err := sl.Set(""); err == nil {
t.Errorf("expected error for empty string")
}
if err := sl.Set(","); err == nil {
t.Errorf("expected error for list of empty strings")
}
}