Help us shape the future of Go! Take the 2026 Go Developer Survey

mageutil

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureDir

func EnsureDir(dir string)

Creates and sets permissions on a directory. Idempotent.

func EnvOrDefault

func EnvOrDefault(key string, def string) string

func FromEnvOrDefault

func FromEnvOrDefault(key string, def string) string

Attempt to retrieve a value from an environment variable if it is set. If not, use specified default value

func FromEnvOrF

func FromEnvOrF(key string, fallback func() string) string

Attempt to retrieve a value from an environment variable if it is set. If not, use fallback function to generate value.

func PanicOnError

func PanicOnError(err error)

func RandomHex

func RandomHex(length int) string

Generates a (non-cryptographically) random hex string of a given length

func RequireEnv

func RequireEnv(key string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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