Created
August 4, 2016 14:48
-
-
Save emilevauge/3b1934a140b323fef6306199420d7b5d to your computer and use it in GitHub Desktop.
test
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
//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