Skip to content

Instantly share code, notes, and snippets.

@cocap10
Last active August 4, 2016 15:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cocap10/600d3491c9f005195c3c8bc9234dfc99 to your computer and use it in GitHub Desktop.
Save cocap10/600d3491c9f005195c3c8bc9234dfc99 to your computer and use it in GitHub Desktop.
Golang Configuration Made Easy With Flæg And Stært
flaegCmd := &flaeg.Command{
Name: "flaegdemo",
Description: "flaegdemo is a golang program...(here the program description)",
Config: &config,
DefaultPointersConfig: &defaultConfigOfPointerFields,
Run: func() error {
printableConfig, _ := json.Marshal(config)
fmt.Printf("%s\n", printableConfig)
return nil
},
}
// config and defaultConfigOfPointerFields has been defined on
// https://github.com/cocap10/flaegdemo/blob/master/flaegdemo.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment