Last active
September 28, 2015 06:29
-
-
Save pistarlabs/95c1eb35d9a4116c92d9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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