Skip to content

Instantly share code, notes, and snippets.

@emilevauge
Created August 4, 2016 14:48
Show Gist options
  • Save emilevauge/3b1934a140b323fef6306199420d7b5d to your computer and use it in GitHub Desktop.
Save emilevauge/3b1934a140b323fef6306199420d7b5d to your computer and use it in GitHub Desktop.
test
//Configuration is a struct which contains all differents type to field
//using parsers on string, time.Duration, pointer, bool, int, int64, time.Time, float64
type Configuration struct {
VersionName string //no description struct tag, it will not be flaged
LogLevel string `short:"l" description:"Log level"` //string type field, short flag "-l"
Timeout time.Duration `description:"Timeout duration"` //time.Duration type field
Db *DatabaseInfo `description:"Enable database"` //pointer type field (on DatabaseInfo)
Owner *OwnerInfo `description:"Enable Owner description"` //another pointer type field (on OwnerInfo)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment