// section.key or key
198047
func (c *JSONConfigContainer) getData(key string) interface{} {
	if len(key) == 0 {
		return nil
	}

	c.RLock()
	defer c.RUnlock()

	sectionKeys := strings.Split(key, "::")
	if len(sectionKeys) >= 2 {
		curValue, ok := c.data[sectionKeys[0]]
		if !ok {
			return nil
		}
		for _, key := range sectionKeys[1:] {
			if v, ok := curValue.(map[string]interface{}); ok {
				if curValue, ok = v[key]; !ok {
					return nil
				}
			}
		}
		return curValue
	}
	if v, ok := c.data[key]; ok {
		return v
	}
	return nil
}
853686
func (c *ConfigParser) Sections() (res []string) {
	for k, _ := range c.sections {
		res = append(res, k)
	}
	return res
}
784732
func (ini *INI) Set(section, key, value string) {
	sec := ini.getSection(section)
	if sec == nil {
		sec = ini.addSection(section)
	} else {
		// The section name may be different.
		sec.Name = section
	}

	if key == "" {
		// Only add the newline if it is the first one.
		if n := len(sec.Data); n > 0 && sec.Data[n-1] != nil {
			sec.Data = append(sec.Data, nil)
		}
		return
	}

	if item := sec.getItem(key, ini.isCaseSensitive); item != nil {
		// The key does exist.
		item.Key = key
		item.Value = value
		return
	}
	// The key does not exist.
	sec.Data = append(sec.Data, &iniItem{Key: key, Value: value})
}
355162
func (s *Section) Option(key string) string {
	return s.Options.Get(key)
}
574243
func (f *File) Sections() []*Section {
	if f.BlockMode {
		f.lock.RLock()
		defer f.lock.RUnlock()
	}

	sections := make([]*Section, len(f.sectionList))
	for i, name := range f.sectionList {
		sections[i] = f.sections[name]
	}
	return sections
}
1332682
func (d *localeStore) Get(lang, section, format string) (string, bool) {
	if locale, ok := d.store[lang]; ok {
		if key, err := locale.message.Section(section).GetKey(format); err == nil {
			return key.Value(), true
		}
	}

	if len(d.defaultLang) > 0 && lang != d.defaultLang {
		return d.Get(d.defaultLang, section, format)
	}

	return "", false
}
933932
func (ini *INI) Get(section, key string) string {
	if v := ini.get(section, key); v != nil {
		return *v
	}
	return ""
}
356994
func (c *IniConfigContainer) getdata(key string) string {
	if len(key) == 0 {
		return ""
	}
	c.RLock()
	defer c.RUnlock()

	var (
		section, k string
		sectionKey = strings.Split(strings.ToLower(key), "::")
	)
	if len(sectionKey) >= 2 {
		section = sectionKey[0]
		k = sectionKey[1]
	} else {
		section = defaultSection
		k = sectionKey[0]
	}
	if v, ok := c.data[section]; ok {
		if vv, ok := v[k]; ok {
			return vv
		}
	}
	return ""
}
1186348
func (ini *INI) SectionGetBool(section, key string) (bool, bool) {
    v, ok := ini.SectionGet(section, key)
    if ok {
        switch v {
        case "1", "t", "T", "true", "TRUE", "True", "on", "ON", "On", "yes", "YES", "Yes":
            return true, true
        case "0", "f", "F", "false", "FALSE", "False", "off", "OFF", "Off", "no", "NO", "No":
            return false, true
        }
    }

    return false, false
}
729044
func (p *Path) Key(key string) *Path {
	return &Path{index: key, parent: p}
}
819
func (ini *INI) Del(section, key string) bool {
	// Remove the section.
	if key == "" {
		if section == "" {
			ini.global = iniSection{}
			return true
		}

		return ini.rmSection(section)
	}

	// Remove the key for the section.
	return ini.getSection(section).rmItem(key, ini.isCaseSensitive)
}
1018977
func (ini *INI) Delete(section, key string) {
    kvmap, ok := ini.GetKvmap(section)
    if ok {
        delete(kvmap, key)
    }
}
717721
func (s *Section) ParentKeys() []*Key {
	var parentKeys []*Key
	sname := s.name
	for {
		if i := strings.LastIndex(sname, "."); i > -1 {
			sname = sname[:i]
			sec, err := s.f.GetSection(sname)
			if err != nil {
				continue
			}
			parentKeys = append(parentKeys, sec.Keys()...)
		} else {
			break
		}

	}
	return parentKeys
}
740191
func (this *MarkupAsciiDoc) sectionHeader(level int, text string) string {
	return fmt.Sprintf("%s %s\n", strings.Repeat("=", level), text)
}
648933
func (c *RawMap) SectionInConfig(section string) bool {
	for s := range *c {
		if section == s {
			return true
		}
	}
	return false
}
916152
func (f *File) RemoveKey(key string) {
	name, k := f.NameSplitFunc(key)

	// get the section
	section := f.GetSection(name)
	if section == nil {
		return
	}

	section.RemoveKey(k)
}
415119
func (c *IniConfigContainer) Set(key, value string) error {
	c.Lock()
	defer c.Unlock()
	if len(key) == 0 {
		return errors.New("key is empty")
	}

	var (
		section, k string
		sectionKey = strings.Split(key, "::")
	)

	if len(sectionKey) >= 2 {
		section = sectionKey[0]
		k = sectionKey[1]
	} else {
		section = defaultSection
		k = sectionKey[0]
	}

	if _, ok := c.data[section]; !ok {
		c.data[section] = make(map[string]string)
	}
	c.data[section][k] = value
	return nil
}