Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Load ¶
Load loads environment variables from the filepaths specified. If no filepaths are specified, it defaults to reading .env. It may return an error when a file cannot be read, the file has bad syntax, or the syscall to set the environment variable fails.
func Unmarshal ¶
Unmarshal unmarshals environment variables into a struct. If no filepaths are specified, it defaults to reading .env.
Supported types are: string, int, int8, int16, int32, int64, uint, uint8, uint16, uint32, and uint64.
A struct field can specify whether or not the environment variable is required to be provided in any of the .env files with the `required` struct tag. If it is not provided, it defaults to true.
It may return an error if s is not a pointer to a struct, a file cannot be read, the file has bad syntax, a required field is not provided, or a provided field cannot be made into the type in the struct field.
Types ¶
This section is empty.