Get config value each environments
go get github.com/ushios/config
sample.cfg:
[DEFAULT]
host: github.local
[dev]
host: dev.github.com
[prd]
host: github.com
execute:
$ go-bindata -pkg config sample.cfg database.cfg
sample.go:
assetByte, _ := config.Asset("sample.cfg")
buffer := bytes.NewBuffer(assetByte)
c, err := configo.Instance(bufio.NewReader(buffer), "dev")
fmt.Println(c.String("host")) // dev.github.com
The source files are distributed under the Mozilla Public License, version 2.0,
unless otherwise noted.
Please read the FAQ
if you have further questions regarding the license.