Skip to content

Instantly share code, notes, and snippets.

@pistarlabs
Last active September 28, 2015 06:29
Show Gist options
  • Save pistarlabs/95c1eb35d9a4116c92d9 to your computer and use it in GitHub Desktop.
Save pistarlabs/95c1eb35d9a4116c92d9 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"github.com/pistarlabs/configs"
)
func main() {
// Initialize config
cfg, err := configs.Load("/path/to/config.json")
if err != nil {
panic(err)
}
// Get development environment configuration
cfg, err = cfg.Get("development")
if err != nil {
panic(err)
}
fmt.Printf("Database host is %s", cfg.UString("database.host"))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment