For import library. go get github.com/imarenco/goenv for use into your Project: err := goenv.AutoLoad() os.Getenv("variable")