func (p *ConfigParser) Options(section string) ([]string, error) {
	if !p.HasSection(section) {
		return nil, getNoSectionError(section)
	}
	seenOptions := make(map[string]bool)
	for _, option := range p.config[section].Options() {
		seenOptions[option] = true
	}
	for _, option := range p.defaults.Options() {
		seenOptions[option] = true
	}
	options := make([]string, 0)
	for option := range seenOptions {
		options = append(options, option)
	}
	sort.Strings(options)
	return options, nil
}
Options returns a list of option mames for the given section name.

Returns an error if the section does not exist.
package configparser
import (
	"fmt"
	"sort"
	"strconv"
)
func (p *ConfigParser) isDefaultSection(section string) bool {
	return section == defaultSectionName
}
func (p *ConfigParser) Defaults() Dict {
	return p.defaults.Items()
}
func (p *ConfigParser) Sections() []string {
	sections := make([]string, 0)
	for section := range p.config {
		sections = append(sections, section)
	}
	sort.Strings(sections)
	return sections
}
func (p *ConfigParser) AddSection(section string) error {
	if p.isDefaultSection(section) {
		return fmt.Errorf("Invalid section name: '%s'", section)
	} else if p.HasSection(section) {
		return fmt.Errorf("Section '%s' already exists", section)
	}
	p.config[section] = newSection(section)
	return nil
}
func (p *ConfigParser) HasSection(section string) bool {
	_, present := p.config[section]
	return present
}