Skip to content

Commit

Permalink
Merge pull request kubernetes#2814 from satnam6502/list
Browse files Browse the repository at this point in the history
Do not consider an empty string to be an error in list.go
  • Loading branch information
jbeda committed Dec 11, 2014
2 parents 5865ab7 + 7582884 commit 5523e03
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 13 deletions.
3 changes: 0 additions & 3 deletions pkg/util/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 0 additions & 10 deletions pkg/util/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}

0 comments on commit 5523e03

Please sign in to comment.