为了账号安全,请及时绑定邮箱和手机立即绑定

通过 Brew 安装时如何设置 GOROOT?

通过 Brew 安装时如何设置 GOROOT?

Go
慕工程0101907 2023-02-21 19:03:54
我使用以下命令安装了 Go:brew install go现在安装在/opt/homebrew/Cellar/go/1.19.2我比这样设置变量:export GOROOT=/opt/homebrew/Cellar/go/1.19.2/bin/go/libexecexport GOPATH=$HOME/goexport PATH=$PATH:$GOPATH/bin当我尝试时,go env我得到了这个:go: cannot find GOROOT directory: /opt/homebrew/Cellar/go/1.19.2/bin/go/libexec这里有什么错误?
查看完整描述

1 回答

?
呼如林

TA贡献1798条经验 获得超3个赞

一些修复:

  • export GOROOT="$(brew --prefix golang)/libexec"

  • 不要设置 GOROOT

  • 使用官方安装程序而不是 brew(推荐)。


查看完整回答
反对 回复 2023-02-21
  • 1 回答
  • 0 关注
  • 299 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号