Parse environment variables into structs
mainYou can parse environment variables into a struct using either the pointer-based Parse function or the generic-based ParseAs function.
Note: Unexported fields in your struct will be ignored by the parser.
type config struct {
Home string `env:"HOME"`
}
// parse using a pointer
var cfg config
err := env.Parse(&cfg)
// parse using generics
cfg, err := env.ParseAs[config]()