Skip to content

Instantly share code, notes, and snippets.

@webdev
Created October 13, 2013 00:07
Show Gist options
  • Save webdev/6956411 to your computer and use it in GitHub Desktop.
Save webdev/6956411 to your computer and use it in GitHub Desktop.
package main
var (
Config config.Config
)
func init() {
yamlString, err := ioutil.ReadFile("./config.yaml")
cfg, err := config.ParseYaml(string(yamlString))
Config, err := cfg.Get(env)
// The value of Config is what I expect to be
}
func main() {
server_port, err := Config.String("server_port")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment