@ -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{}{}
|
||||
}
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user