config/config.go
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) 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
}
// Read function reads configurations from the file defined in
// Config.filename.