Answers for "add environment variable golang"

Go
0

golang set env var

// set env var "FOO" to value "1"
    os.Setenv("FOO", "1")
    // will print "FOO: 1"
    fmt.Println("FOO:", os.Getenv("FOO"))
Posted by: Guest on October-29-2020
0

golang env example

os.Setenv("GO_ENV", "production")
fmt.Println(os.Getenv("GO_ENV"))
Posted by: Guest on October-04-2021

Code answers related to "add environment variable golang"

Browse Popular Code Answers by Language