在它发生之前,我正在做的是尝试使用dep来管理我的golang代码依赖关系。我现在发现的是我无法使用go执行任何命令,即使我尝试使用brew by卸载它brew uninstall go
并brew install go
再次执行。
如果我这样做go env
,它将显示如下:
$ go env
go: cannot find GOROOT directory: /usr/local/cellar/go/1.13.1/libexec
$ ls /usr/local/Cellar/go/1.13.8/libexec/
CONTRIBUTING.md SECURITY.md bin lib robots.txt
CONTRIBUTORS VERSION doc misc src
PATENTS api favicon.ico pkg test
$ go version
go: cannot find GOROOT directory: /usr/local/cellar/go/1.13.1/libexec
$ go build
go: cannot find GOROOT directory: /usr/local/cellar/go/1.13.1/libexec
$ echo $GOPATH
/Users/mymac/go
$ echo $GOROOT
$
我应该怎么做和检查?