How to get an environment variable in Go?

In Go lang, how to get an environment variable?

asked Mar 17 by anonymous

1 Answer

To get an environment variable (e.g. "VAR") in GO:

import "os"
import "fmt"

fmt.Println("VAR:", os.Getenv("VAR"))
answered Mar 30 by zma (380 points)

Please log in or register to answer this question.

Copyright © SysTutorials. User contributions licensed under cc-wiki with attribution required.
Hosted on Dreamhost