Documentation ¶
Overview ¶
Package env provides a simple way to load environment variables into a struct.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
// Validator is the default validator used to validate the configuration.
Validator = validator.New(validator.WithRequiredStructEnabled())
)
Functions ¶
func Load ¶
Load loads the environment configuration into a struct T.
By default if no paths are provided, it will look for a file called .env. If no file is found, it will simply ignore it.
Make sure to use the `env` tag from the github.com/caarlos0/env/v11 package, to specify the environment variable name.
The populated struct is validated using `Validator`.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.