doumu8217 2018-01-06 20:09
浏览 405
已采纳

在Golang和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

  • 写回答

2条回答 默认 最新

  • dsfdsf46465 2018-01-06 20:50
    关注

    Restarted my pc. Now, it works fine.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?