Documentation
¶
Overview ¶
Package envflag is a wrapper for stdlib's flag that adds the environment variables as additional source of the values for flags.
Index ¶
- func Bool(name string, defaultValue bool, usage string) (*bool, error)
- func Int(name string, defaultValue int, usage string) (*int, error)
- func MustBool(name string, defaultValue bool, usage string) *bool
- func MustInt(name string, defaultValue int, usage string) *int
- func String(name, defaultValue, usage string) *string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bool ¶
Bool is a convenience wrapper for boolean flag that picks its default value from the environment variable. It returns error if the environment variable's value can not be resolved into definitive `true` or `false`.
func Int ¶
Int is a convenience wrapper for integer flag that picks its default value from the environment variable. It returns error if the environment variable's value can not be parsed into integer.
func MustBool ¶
MustBool handles error (if any) returned by Bool according to the behaviour configured by `flag.CommandLine.ErrorHandling()` by either ignoring it, exiting the process with status code 2, or panicking.
Types ¶
This section is empty.