// Set is the method to set the flag value, part of the flag.Value interface.
// Set's argument is a string to be parsed to set the flag.
// It's a comma-separated list, so we split it.
323318
func (s *sliceOfStrings) Set(value string) error {
	parts := strings.Split(value, ",")
	if len(parts) == 0 {
		return fmt.Errorf("bad []string format: %s", value)
	}
	for _, entrypoint := range parts {
		*s = append(*s, entrypoint)
	}
	return nil
}
297233
func (m *ColonSeparatedMultimapStringString) Set(value string) error {
	if m.Multimap == nil {
		return fmt.Errorf("no target (nil pointer to map[string][]string)")
	}
	if !m.initialized || *m.Multimap == nil {
		// clear default values, or allocate if no existing map
		*m.Multimap = make(map[string][]string)
		m.initialized = true
	}
	for _, pair := range strings.Split(value, ",") {
		if len(pair) == 0 {
			continue
		}
		kv := strings.SplitN(pair, ":", 2)
		if len(kv) != 2 {
			return fmt.Errorf("malformed pair, expect string:string")
		}
		k := strings.TrimSpace(kv[0])
		v := strings.TrimSpace(kv[1])
		(*m.Multimap)[k] = append((*m.Multimap)[k], v)
	}
	return nil
}
680981
func (h *mapHandler) Set(key string, value interface{}, args ...interface{}) error {
	if len(args) != 0 {
		return cfg.ErrArgsNotSupported
	}
	h.values[key] = value
	return nil
}
197108
func (scope *ArgScope) Set(key string, v interface{}) error {
	str, ok := v.(string)
	if !ok {
		return fmt.Errorf("%v is not a string", v)
	}
	scope.data[key] = str
	return nil
}
482277
func (i *Uint64Opt) Set(s string) error {
	v, err := strconv.ParseUint(s, 0, 64)
	i.value = &v
	return err
}
99591
func (p *Params) Set(key, value string) {
	if len(key) == 0 {
		return
	}
	if key[0] != ':' && key[0] != '*' {
		key = ":" + key
	}

	for i, v := range *p {
		if v.Name == key {
			(*p)[i].Value = value
			return
		}
	}

	*p = append(*p, param{key, value})
}
490686
func (u *URLs) Set(s string) error {
	for _, t := range strings.Split(s, ",") {
		url, err := url.Parse(t)
		if err != nil {
			return err
		}

		*u = append(*u, *url)
	}

	return nil
}
495252
func (s *StreamName) Set(value string) error {
	v := StreamName(value)
	if err := v.Validate(); err != nil {
		return err
	}
	*s = v
	return nil
}
120770
func (f *StructField) Set(v interface{}, seps ...rune) error {
	return Set(f.value, v, seps...)
}
1141809
func (f *fieldSliceFlag) Set(val string) error {
	*f = append(*f, googleapi.Field(val))
	return nil
}
393632
func (m *ImageMap) Set(value string) error {
	parts := strings.Split(value, ",")
	if len(parts) != 2 {
		return fmt.Errorf("bad format")
	}

	(*m)[parts[0]] = parts[1]
	return nil
}
929046
func (p *EnumParam) Set(s string) error {
	found := false
	for _, v := range p.values {
		if s == v {
			found = true
		}
	}
	if !found {
		return trace.Errorf(
			"value '%v' is not one of the allowed '%v'",
			s, strings.Join(p.values, ","),
		)
	}
	p.value = &s
	return nil
}
509702
func (p *StringParam) Set(s string) error {
	p.val = &s
	return nil
}
316503
func (ns *Namespaces) Set(str string) error {
	fargs := func(c rune) bool {
		return c == ',' || c == ';'
	}
	// get function
	slice := strings.FieldsFunc(str, fargs)
	*ns = append(*ns, slice...)
	return nil
}
819391
func (t *TagMap) Set(key string) error {
	return (*stringmapflag.Value)(t).Set(key)
}
823154
func Set(value reflect.Value, v interface{}, seps ...rune) error {
	if !value.CanSet() {
		return errCannotSet
	}

	if s, ok := v.(string); ok {
		return UnmarshalValue(value, s, seps...)
	}

	val := reflect.ValueOf(v)
	if value.Kind() != val.Kind() {
		// The value was converted.
		v, err := convert(val, value)
		if err != nil {
			return err
		}
		val = v
	}
	value.Set(val)
	return nil
}
1161642
func (l LDFlags) Set(s string) error {
	segments := strings.SplitN(s, ":", 2)
	flag := segments[0]

	val := l[flag]
	if len(segments) == 2 {
		val = strings.Split(segments[1], ",")
	}
	l[flag] = append(l[flag], val...)

	return nil
}