Documentation
¶
Overview ¶
gotenv is a general-purpose package to load environment variables from files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadEnv ¶
LoadEnv assumes default values for LoadEnvFromFile, where the filePath is equal to ".env" and the returnNilErrOnNoFile is true. See LoadEnvFromFile for specific documentation on parameters.
func LoadEnvFromFile ¶
func LoadEnvFromFile(filePath string, returnNilErrOnNoFile, overrideExistingVars bool) (map[string]string, error)
LoadEnvFromFile reads a given "env" filePath and populates the current environment with the values inside. Also returns the map object that contains all the environment variable keys along with their values that were present in the file. returnNilErrOnNoFile tells the function to ignore an error when the filePath given does not exist on the filesystem. This is useful in the case where loading the environment file contents isn't critical to the execution of the application.
Types ¶
This section is empty.