duankui1532 2017-06-13 19:54
浏览 203
已采纳

设置后Go环境变量保持不变

I start learning Go programming by watching online tutorials. I use Windows command prompt. However, after I typed set GOOS = darwin then used go env to print environment variables, GOOS was not set to GOOS=darwin but still GOOS=windows as default.


Here is what I got. Could someone tell me where I went wrong such that I cannot make change on GOOS?

C:\GoPath\src\palindrome>set GOOS = darwin

C:\GoPath\src\palindrome>go env
set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
  • 写回答

1条回答 默认 最新

  • duandao7704 2017-06-13 20:37
    关注

    "Any extra spaces around either the variable name or the string, will not be ignored, SET is not forgiving of extra spaces like many other scripting languages."

    Change set GOOS = darwin to set GOOS=darwin - i.e., the same format you see in the output of go env.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突