os.Getenv

The Go function that returns the value of an environment variable, or an empty string if it is not set.

In more detail

It cannot tell unset from set to empty; use os.LookupEnv when that matters. Environment variables are the usual way containers and pipelines pass settings to a program.

Example

fmt.Println("timeout:", os.Getenv("PROBE_TIMEOUT"))

Related terms

Taught in

References