package env

import "github.com/gobuffalo/plush/v5/helpers/env"

Index

Constants

const (
	EnvKey   = "env"
	EnvOrKey = "envOr"
)

Keys to be used in templates for the functions in this package.

Functions

func Env

func Env(key string) (string, error)

Env will return the specified environment variable, or an error if it can not be found

<%= env("GOPATH") %>

func EnvOr

func EnvOr(key string, def string) string

Env will return the specified environment variable, or the second argument, if not found

<%= envOr("GOPATH", "~/go") %>

func New

func New() hctx.Map

New returns a map of the helpers within this package.

Source Files

env.go

Version
v5.0.5 (latest)
Published
May 23, 2025
Platform
linux/amd64
Imports
3 packages
Last checked
2 weeks ago

Tools for package owners.