我对GoLang来说是全新的,所以我很有可能搞砸了我的设置。
这就是我所拥有的:
echo $GOPATH
/Users/name/Documents/Developer/Go_Workspace
这个有效。
name$ go get -v golang.org/x/tools/cmd/oracle
它在Go_Workspace中创建了2个子文件夹 - > src,bin,pkg。
然后当我尝试:
go get -u golang.org/x/tools/cmd/oracle
package golang.org/x/tools/cmd/oracle: cannot find package "golang.org/x/tools/cmd/oracle" in any of:
/usr/local/go/src/golang.org/x/tools/cmd/oracle (from $GOROOT)
/Users/name/Documents/Developer/Go_Workspace/src/golang.org/x/tools/cmd/oracle (from $GOPATH)
启用-v
时,我看到:
Fetching https://golang.org/x/tools/cmd/oracle?go-get=1
Parsing meta tags from https://golang.org/x/tools/cmd/oracle?go-get=1 (status code 200)
get "golang.org/x/tools/cmd/oracle": found meta tag main.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/cmd/oracle?go-get=1
get "golang.org/x/tools/cmd/oracle": verifying non-authoritative meta tag
Fetching https://golang.org/x/tools?go-get=1
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200)
golang.org/x/tools (download)
package golang.org/x/tools/cmd/oracle: cannot find package "golang.org/x/tools/cmd/oracle" in any of:
/usr/local/go/src/golang.org/x/tools/cmd/oracle (from $GOROOT)
/Users/name/Documents/Developer/Go_Workspace/src/golang.org/x/tools/cmd/oracle (from $GOPATH)
这是我的.bash_profile
1 PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin
2 export GOPATH=$HOME/Documents/Developer/Go_Workspace
3 export PATH=$PATH:/usr/local/go/bin
4 export PATH=$PATH:$GOPATH/bin
你能帮我解决这个问题吗?我搞砸了什么?
我在MacOS上运行bash终端。