pkg/flags/unique_urls.go
func (us *UniqueURLs) Set(s string) error {
	if _, ok := us.Values[s]; ok {
		return nil
	}
	if _, ok := us.Allowed[s]; ok {
		us.Values[s] = struct{}{}
		return nil
	}
	ss, err := types.NewURLs(strings.Split(s, ","))
	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)
	}
	return nil
}
func (us *UniqueURLs) Set(s string) error {
	if _, ok := us.Values[s]; ok {
		return nil
	}
	if _, ok := us.Allowed[s]; ok {
		us.Values[s] = struct{}{}
		return nil
	}
	ss, err := types.NewURLs(strings.Split(s, ","))
	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)
	}
	return nil
}
func ( us * UniqueURLs ) Set ( s string ) error { if _ , ok := us . Values [ s ] ; ok { return nil } if _ , ok := us . Allowed [ s ] ; ok { us . Values [ s ] = struct { } { } return nil } ss , err := types . NewURLs ( strings . Split ( s , " " ) ) 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 ) } return nil }
// Set parses a command line set of URLs formatted like:
// http://127.0.0.1:2380,http://10.1.1.2:80
// Implements "flag.Value" interface.
Set parses a command line set of URLs formatted like : http : // 127 . 0 . 0 . 1 : 2380 http : // 10 . 1 . 1 . 2 : 80 Implements flag . Value interface .