env

package
v1.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package env provides environment variable utilities for Buffalo. This package replaces the github.com/gobuffalo/envy dependency.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Environ

func Environ() []string

Environ returns a copy of the environment variables.

func Get

func Get(key, fallback string) string

Get returns the value of the environment variable named by key. If the variable is not set or is empty, it returns the fallback value.

func GoPath

func GoPath() string

GoPath returns the GOPATH environment variable. If GOPATH is not set, it returns the default GOPATH: $HOME/go

func Load

func Load(filenames ...string) error

Load loads .env file(s) into environment. If no filenames are provided, it loads the .env file in the current directory.

func MustGet

func MustGet(key string) (string, error)

MustGet returns the value of the environment variable named by key. It returns an error if the variable is not set or is empty.

func Set

func Set(key, value string)

Set sets the environment variable named by key to value.

func Temp

func Temp(f func())

Temp executes f with temporarily modified environment variables. After f returns, the environment is restored to its original state.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL