env

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clear

func Clear(vars ...string) (err error)

Clear sets provided environment variables to the empty string "".

func Reset

func Reset() error

Reset takes the env variables saved by env.Save and restores them to the environment. If env.Save has not previously been called, this does nothing.

func Save

func Save(vars ...string) error

Save takes the contents of the provided env variables and saves them in a map. Intended to use before env.Clear. Restore with env.Reset

func Set

func Set(vars ...string) error

Set enables setting multiple environment variables by putting them after one another. Example: env.FromStrings("USER", "guest", "PASSWORD", "qwer1234")

func SetMap

func SetMap(vars map[string]string) error

SetMap enables setting multiple environment variables from a map. Example: m := map[string]string{"USER": "guest", "PASSWORD": "qwer1234"} env.FromMap(m)

Types

This section is empty.

Jump to

Keyboard shortcuts

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