thelearner
thelearner

Reputation: 1136

Unable to receive environment variables in Golang and Windows 10

I have set a couple of environment variables in Windows 10, but I cannot receive them in Golang and I just can't find out why.

enter image description here

dbUser := os.Getenv("DB_USER")
dbName := os.Getenv("DB_NAME")

enter image description here

Upvotes: 4

Views: 8208

Answers (1)

thelearner
thelearner

Reputation: 1136

Restarted my pc. Now, it works fine.

Upvotes: 4

Related Questions