package
0.24.0
Repository: https://github.com/lushdigital/core.git
Documentation: pkg.go.dev

# README

Env

The core/env package provides functionality for ensuring we retrieve an environment variable

Example

Loading default environment config

env.TryLoadDefault()

Loading default environment config together with other source

env.TryLoadDefault("package/other.env")

Expect environment variable to be set

dbURL := env.MustGet("DATABASE_URL")

# Functions

MustGet returns an environment variable by name If the requested variable does not exist, we throw a fatal error.
TryLoadDefault will attempt to load the default environment variables.
TryOverloadDefault will attempt to load the default environment variables.