Documentation
¶
Overview ¶
Package envconfig populates Go structs from environment variables. Field names are mapped to env var names via the `env` struct tag.
Example:
type Config struct {
Host string `env:"HOST" default:"localhost"`
Port int `env:"PORT" default:"8080"`
}
var cfg Config
if err := envconfig.Load(&cfg); err != nil { ... }
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Load ¶
func Load(dst interface{}) error
Load reads environment variables into dst, which must be a pointer to a struct. Each exported field is mapped via its `env` tag; if absent the field name is upper-cased and used directly. The `default` tag supplies a fallback value.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.