Commit 5523e034 authored by Joe Beda's avatar Joe Beda

Merge pull request #2814 from satnam6502/list

Do not consider an empty string to be an error in list.go
parents 5865ab75 7582884f
......@@ -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
......
......@@ -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")
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment