Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetFlagsFromEnv ¶
SetFlagsFromEnv parses all registered flags in the given flagset, and if they are not already set it attempts to set their values from environment variables. Environment variables take the name of the flag but are UPPERCASE, and any dashes are replaced by underscores. Environment variables additionally are prefixed by the given string followed by and underscore. For example, if prefix=PREFIX: some-flag => PREFIX_SOME_FLAG
func SetFlagsFromEnvFile ¶
SetFlagsFromEnvFile iterates the given flagset and if any flags are not already set it attempts to set their values from the given env file. Env files may have KEY=VALUE lines where the environment variable names are in UPPERCASE, prefixed by the given PREFIX, and dashes are replaced by underscores. For example, if prefix=PREFIX, some-flag is named PREFIX_SOME_FLAG. Comment lines are skipped, but more complex env file parsing is not performed.
Types ¶
type IPv4Flag ¶
type IPv4Flag struct {
// contains filtered or unexported fields
}
IPv4Flag parses a string into a net.IP after asserting that it is an IPv4 address. This type implements the flag.Value interface.
type StringSliceFlag ¶
type StringSliceFlag []string
StringSliceFlag parses a comma-delimited list of strings into a []string. This type implements the flag.Value interface.
func (*StringSliceFlag) Set ¶
func (ss *StringSliceFlag) Set(v string) error
func (*StringSliceFlag) String ¶
func (ss *StringSliceFlag) String() string