conf.go
func (c *ConfigFile) GetKeyList(section string) []string {
	// Blank section name represents DEFAULT section.
	if len(section) == 0 {
		section = DEFAULT_SECTION
	}

	if c.BlockMode {
		c.lock.RLock()
		defer c.lock.RUnlock()
	}

	// Check if section exists.
	if _, ok := c.data[section]; !ok {
		return nil
	}

	// Non-default section has a blank key as section keeper.
	list := make([]string, 0, len(c.keyList[section]))
	for _, key := range c.keyList[section] {
		if key != " " {
			list = append(list, key)
		}
	}
	return list
}
func (c *ConfigFile) GetKeyList(section string) []string {
	// Blank section name represents DEFAULT section.
	if len(section) == 0 {
		section = DEFAULT_SECTION
	}

	if c.BlockMode {
		c.lock.RLock()
		defer c.lock.RUnlock()
	}

	// Check if section exists.
	if _, ok := c.data[section]; !ok {
		return nil
	}

	// Non-default section has a blank key as section keeper.
	list := make([]string, 0, len(c.keyList[section]))
	for _, key := range c.keyList[section] {
		if key != " " {
			list = append(list, key)
		}
	}
	return list
}
// GetKeyList returns the list of all keys in give section
// in the same order in the file.
// It returns nil if given section does not exist.