func (c *Config) WriteTo(filename string) error {
	content := ""
	for k, v := range c.config {
		format := "%v = %v\n"
		if k != "" {
			content += fmt.Sprintf("[%v]\n", k)
			format = "\t" + format
		}
		for key, value := range v {
			content += fmt.Sprintf(format, key, value)
		}
	}
	return ioutil.WriteFile(filename, []byte(content), 0644)
}
WriteTo function writes the configuration to a new file. This function
re-organizes the configuration and deletes all the comments.
package config
import (
	"bufio"
	"errors"
	"fmt"
	"io/ioutil"
	"os"
	"strings"
)
var commentPrefix = []string{"//", "#", ";"}
type Config struct {
	filename string
	config   map[string]map[string]string
}
func NewConfig(filename string) *Config {
	c := new(Config)
	c.filename = filename
	c.config = make(map[string]map[string]string)
	return c
}
func (c *Config) Filename() string {
	return c.filename
}
func (c *Config) SetFilename(filename string) {
	c.filename = filename
}
func (c *Config) Reset() {
	c.config = make(map[string]map[string]string)
}
func (c *Config) Read() error {
	in, err := os.Open(c.filename)
	if err != nil {
		return err
	}
	defer in.Close()
	scanner := bufio.NewScanner(in)
	line := ""
	section := ""
	for scanner.Scan() {
		if scanner.Text() == "" {
			continue
		}
		if line == "" {
			sec, ok := checkSection(scanner.Text())
			if ok {
				section = sec
				continue
			}
		}
		if checkComment(scanner.Text()) {
			continue
		}
		line += scanner.Text()
		if strings.HasSuffix(line, "\\") {
			line = line[:len(line)-1]
			continue
		}
		key, value, ok := checkLine(line)
		if !ok {
			return errors.New("WRONG: " + line)
		}
		c.Set(section, key, value)
		line = ""
	}
	return nil
}
func (c *Config) Get(section string, key string) string {
	value, ok := c.config[section][key]
	if !ok {
		return ""
	}
	return value
}
func (c *Config) Set(section string, key string, value string) {
	_, ok := c.config[section]
	if !ok {
		c.config[section] = make(map[string]string)
	}
	c.config[section][key] = value
}
func (c *Config) Add(section string, key string, value string) {
	c.Set(section, key, value)
}
func (c *Config) Del(section string, key string) {
	_, ok := c.config[section]
	if ok {
		delete(c.config[section], key)
		if len(c.config[section]) == 0 {
			delete(c.config, section)
		}
	}
}
func (c *Config) Write() error {
	return nil
}