Documentation
¶
Overview ¶
Package env provides functionality for ensuring we retrieve an environment variable
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustGet ¶
MustGet returns an environment variable by name If the requested variable does not exist, we throw a fatal error
Example ¶
package main
import (
"log"
"github.com/LUSHDigital/core/env"
)
func main() {
var dbURL = env.MustGet("DATABASE_URL")
log.Println(dbURL)
}
func TryLoadDefault ¶ added in v0.5.3
func TryLoadDefault(paths ...string)
TryLoadDefault will attempt to load the default environment variables.
Example ¶
package main
import (
"github.com/LUSHDigital/core/env"
)
func main() {
env.TryLoadDefault()
}
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.