func GetString(section string, key string, def string) string {
	if value, err := get(section, key); err == nil {
		return value
	}
	return def
}
Returns string value from configuration file. If section or key isn't found,
default value will be returned
package conf
import (
	"errors"
	"io/ioutil"
	"share/log"
	"strconv"
	"strings"
)
type keyValue map[string]string
type section map[string]keyValue
var sections = make(section)
func Open(path string) error {
	var f, err = ioutil.ReadFile(path)
	if err != nil {
		return err
	}
	var lines = strings.Split(string(f), "\n")
	var section = ""
	for i := 0; i < len(lines); i++ {
		var line = strings.TrimSpace(lines[i])
		line = strings.Replace(line, "\r", "", -1)
		var size = len(line)
		if size == 0 {
			continue
		}
		if line[0] == ';' || line[0] == '#' {
			continue
		}
		if line[0] == '[' {
			section = strings.Split(line, "]")[0]
			section = strings.Replace(section, "[", "", 1)
			section = strings.TrimSpace(section)
			if len(section) == 0 {
				return errors.New("Error parsing configuration file!")
			}
		} else {
			var data = strings.Split(line, ";")[0]
			var split = strings.Index(line, "=")
			var key = strings.TrimSpace(data[:split])
			var value = strings.TrimSpace(data[split+1:])
			if sections[section] == nil {
				sections[section] = make(keyValue)
			}
			var tmp = sections[section]
			tmp[key] = value
			if strings.ToLower(key) == "password" {
				value = "******"
			}
		}
	}
	return nil
}
func SectionExist(section string) bool {
	if sections[section] == nil {
		return false
	}
	return true
}