// The following methods are required to implement pflag Value interface.
// Set sets the time quantum value.
8631
func (q *TimeQuantum) Set(value string) error {
	*q = TimeQuantum(value)
	return nil
}
80415
func (pb *ProgressBar) Set(current int) *ProgressBar {
	return pb.Set64(int64(current))
}
278789
func (d *Duration) Set(value string) error {
	dur, err := readDuration(value)
	*d = Duration(dur)
	return err
}
112157
func (p *pin) Set() {
	_, p.err = p.valueFile.Write(bytesSet)
}
1025744
func (f *tokenFuture) Set(token string) *tokenFuture {
	f.m.Lock()
	defer f.m.Unlock()

	f.set = true
	f.token = token
	for _, w := range f.waiting {
		close(w)
	}
	f.waiting = nil
	return f
}
99807
func (a MultiStatsClient) Set(name string, value string, rate float64) {
	for _, c := range a {
		c.Set(name, value, rate)
	}
}
656147
func set(m map[string]map[string]struct{}, src, dst string) {
	if _, ok := m[src]; !ok {
		m[src] = make(map[string]struct{})
	}
	m[src][dst] = struct{}{}
}
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
}
674029
func (m *LangleSeparatedMapStringString) Set(value string) error {
	if m.Map == nil {
		return fmt.Errorf("no target (nil pointer to map[string]string)")
	}
	if !m.initialized || *m.Map == nil {
		// clear default values, or allocate if no existing map
		*m.Map = make(map[string]string)
		m.initialized = true
	}
	for _, s := range strings.Split(value, ",") {
		if len(s) == 0 {
			continue
		}
		arr := strings.SplitN(s, "<", 2)
		if len(arr) != 2 {
			return fmt.Errorf("malformed pair, expect string<string")
		}
		k := strings.TrimSpace(arr[0])
		v := strings.TrimSpace(arr[1])
		(*m.Map)[k] = v
	}
	return nil
}
912499
func (d *ResourceData) Set(key string, value interface{}) error {
	d.once.Do(d.init)

	// If the value is a pointer to a non-struct, get its value and
	// use that. This allows Set to take a pointer to primitives to
	// simplify the interface.
	reflectVal := reflect.ValueOf(value)
	if reflectVal.Kind() == reflect.Ptr {
		if reflectVal.IsNil() {
			// If the pointer is nil, then the value is just nil
			value = nil
		} else {
			// Otherwise, we dereference the pointer as long as its not
			// a pointer to a struct, since struct pointers are allowed.
			reflectVal = reflect.Indirect(reflectVal)
			if reflectVal.Kind() != reflect.Struct {
				value = reflectVal.Interface()
			}
		}
	}

	err := d.setWriter.WriteField(strings.Split(key, "."), value)
	if err != nil && d.panicOnError {
		panic(err)
	}
	return err
}
819391
func (t *TagMap) Set(key string) error {
	return (*stringmapflag.Value)(t).Set(key)
}
561704
func (fs *FlagSet) Set(name, value string) error {
	flag, ok := fs.formal[name]
	if !ok {
		return fmt.Errorf("no such flag -%v", name)
	}
	if err := flag.Value.Set(value); err != nil {
		return err
	}
	if fs.actual == nil {
		fs.actual = make(map[string]*Flag)
	}
	fs.actual[name] = flag
	return nil
}
141243
func (m ConcurrentMap) Set(key string, value interface{}) {
	// Get map shard.
	shard := m.GetShard(key)
	shard.Lock()
	shard.items[key] = value
	shard.Unlock()
}
1314174
func (mem *Memory) Set(key string, val interface{}, timeout time.Duration) (err error) {
	mem.Lock()
	defer mem.Unlock()

	mem.data[key] = &data{
		Data:    val,
		Expired: time.Now().Add(timeout),
	}
	return nil
}
1005936
func (c *Context) Set(name, value string) error {
	c.setFlags = nil
	return c.flagSet.Set(name, value)
}
987508
func (s *memoryStore) Set(parent string, scopes []string, token string, TTL time.Duration) error {
	deadline := time.Now().Add(TTL)
	tok := tokenWithDeadline{
		Token:    token,
		Deadline: deadline,
	}

	// store the token for every scope it has
	for _, scope := range scopes {
		key := s.key(parent, scope)
		s.tokens[key] = tok
	}

	return nil
}
74571
func (dst *pguint32) Set(src interface{}) error {
	switch value := src.(type) {
	case int64:
		if value < 0 {
			return errors.Errorf("%d is less than minimum value for pguint32", value)
		}
		if value > math.MaxUint32 {
			return errors.Errorf("%d is greater than maximum value for pguint32", value)
		}
		*dst = pguint32{Uint: uint32(value), Status: Present}
	case uint32:
		*dst = pguint32{Uint: value, Status: Present}
	default:
		return errors.Errorf("cannot convert %v to pguint32", value)
	}

	return nil
}