douchi7073
2017-02-06 20:10
浏览 69
已采纳

Golang 1.6.2无法在OSX Sierra上升级

I just upgraded to OSX Sierra from El Capitan. As such, I also need to upgrade my Golang compiler from 1.6.2 since it does not support Sierra.

I downloaded the latest 1.7.5 pkg installer and ran it, getting the prompt that it would remove previous versions of Go, and it said it was successful. But when I run go version it still says go1.6.2 darwin/amd6.

I have gone so far as to manually delete my /usr/local/bin/go directory and run the 1.7.5 installer again, but go version still says go1.6.2 darwin/amd6. I have also restarted my terminal window and even the full computer between attempts.

What is going wrong? How can I get my Go compiler to update?

图片转代码服务由CSDN问答提供 功能建议

我刚刚从El Capitan升级到OSX Sierra。 因此,我还需要从1.6.2升级我的Golang编译器,因为它不支持Sierra。

我下载了最新的1.7.5 pkg安装程序并运行它,得到提示 它将删除Go的早期版本,并表示成功。 但是当我运行 go version 时,它仍然显示 go1.6.2 darwin / amd6

我可以手动删除了 我的 / usr / local / bin / go 目录并再次运行1.7.5安装程序,但是 go版本仍然显示 go1.6.2 darwin / amd6 。 我还重新启动了终端窗口,甚至两次尝试之间的整个计算机。

出了什么问题? 我如何更新Go编译器?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dougou8458 2017-02-06 20:25
    已采纳

    I was incorrect in my question. I actually deleted usr/local/go, not usr/local/bin/go. I went back and deleted both directories manually, then ran the 1.7.5 package installer again. After restarting my terminal window, go version now shows me I am on 1.7.5 and it appears to be running correctly when I compile my code.

    Still interesting that the package installer did not do this automatically like it said it would. This could work as a solution if someone else is having the same problem.

    点赞 打赏 评论