Browse Source

pkg/flags: fix "Set"

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
Gyuho Lee 7 years ago
parent
commit
089e8ffecb
2 changed files with 3 additions and 0 deletions
  1. 1 0
      pkg/flags/unique_strings.go
  2. 2 0
      pkg/flags/unique_urls.go

+ 1 - 0
pkg/flags/unique_strings.go

@@ -30,6 +30,7 @@ type UniqueStringsValue struct {
 // Implements "flag.Value" interface.
 // The values are set in order.
 func (us *UniqueStringsValue) Set(s string) error {
+	us.Values = make(map[string]struct{})
 	for _, v := range strings.Split(s, ",") {
 		us.Values[v] = struct{}{}
 	}

+ 2 - 0
pkg/flags/unique_urls.go

@@ -46,6 +46,8 @@ func (us *UniqueURLs) Set(s string) error {
 	if err != nil {
 		return err
 	}
+	us.Values = make(map[string]struct{})
+	us.uss = make([]url.URL, 0)
 	for _, v := range ss {
 		us.Values[v.String()] = struct{}{}
 		us.uss = append(us.uss, v)