// Unset removes a key from the configuration map. It returns an error if the
// key is not defined.
//
// Calling this function does not remove a key from a configuration file, only
// from the in-memory configuration object.
15998
func Unset(key string) error {
	var i int
	var part string
	configs.Lock()
	defer configs.Unlock()
	data := configs.data
	m := make(map[interface{}]interface{}, len(data))
	for k, v := range data {
		m[k] = v
	}
	root := m
	parts := strings.Split(key, ":")
	for i, part = range parts {
		if item, ok := m[part]; ok {
			if nm, ok := item.(map[interface{}]interface{}); ok && i < len(parts)-1 {
				m = nm
			} else {
				break
			}
		} else {
			return ErrKeyNotFound{Key: key}
		}
	}
	delete(m, part)
	configs.store(root)
	return nil
}
320846
func (mapOp *MapOperation) RemoveFromSet(key string, value []byte) *MapOperation {
	if mapOp.removeSets != nil {
		delete(mapOp.removeSets, key)
	}
	if mapOp.removeFromSets == nil {
		mapOp.removeFromSets = make(map[string][][]byte)
	}
	mapOp.removeFromSets[key] = append(mapOp.removeFromSets[key], value)
	return mapOp
}
1109069
func (ini *INI) Set(key, value string) {
    ini.SectionSet(DefaultSection, key, value)
}
981385
func (f *fileStorage) Set(key string, value []byte) error {
	file, err := f.fileForWrite(key)

	if err != nil {
		return err
	}

	defer file.Close()

	_, err = file.Write(value)
	return err
}
912247
func Set(key string, value interface{}, args ...interface{}) error {
	return std.Set(key, value, args...)
}
715797
func (h *Handle) Unset(ordinal uint64) error {
	if err := h.validateOrdinal(ordinal); err != nil {
		return err
	}
	_, err := h.set(ordinal, 0, 0, false, true, false)
	return err
}
1072659
func (ctx *Context) Set(key, value string) {
	ctx.SetHeader(key, value)
}
819391
func (t *TagMap) Set(key string) error {
	return (*stringmapflag.Value)(t).Set(key)
}
494765
func (b Bitmap) Unset(idx uint) {
	bucket := idx >> 3
	// Mask should be all ones minus the idx position
	offset := 1 << (idx & 7)
	mask := byte(offset ^ 0xff)
	b[bucket] &= mask
}
240041
func (e Envflag) unsetFlags() map[string]struct{} {

	flags := make(map[string]struct{})

	// get all flag-names.
	e.Cli.VisitAll(func(f *flag.Flag) {
		flags[f.Name] = struct{}{}
	})

	// MINUS from set flag-names.
	e.Cli.Visit(func(f *flag.Flag) {
		delete(flags, f.Name)
	})

	return flags
}
512061
func (s Session) Set(key string, value interface{}) error {
	if value == nil {
		s.Del(key)
		return nil
	}

	s[key] = value
	return nil
}
353563
func (s *Bitset) UnsetAll() *Bitset {
	return s.unitOp(func(s *Bitset, i int) {
		s.set[i] = 0
	})
}
1192623
func (u *User) Set(key string, value interface{}) {
	// Get map shard.
	u.Lock()
	defer u.Unlock()
	u.data[key] = value
}
1372329
func (c configManager) Set(key string, value []byte) error {
	encodedValue, err := secconf.Encode(value, bytes.NewBuffer(c.keystore))
	if err == nil {
		err = c.store.Set(key, encodedValue)
	}
	return err
}
1008087
func (c *Context) Set(key interface{}, value interface{}) {
	store := c.getStore()
	store[key] = value
}
230343
func (h *envHandler) Set(key string, value interface{}, args ...interface{}) error {
	if len(args) != 0 {
		return cfg.ErrArgsNotSupported
	}
	sval, err := cfg.ToString(value)
	if err != nil {
		return cfg.ErrBadType
	}

	err = os.Setenv(key, sval)
	if err != nil {
		return cfg.ErrKeyNotSet
	}

	return nil
}
1040626
func (c standardConfigManager) Set(key string, value []byte) error {
	err := c.store.Set(key, value)
	return err
}