【发布时间】:2013-03-19 05:30:43
【问题描述】:
从 go 文档的外观来看,您似乎必须将正在处理的代码放在 $GOPATH 下——对吗?
我想在 ~/Documents 下的目录中设置一个测试项目,但每次我运行 go install example/newmath(就像在测试示例中一样)时,它都会显示以下内容--
λ MacBook-Air src → go install example/newmath
warning: GOPATH set to GOROOT (/usr/local/go) has no effect
can't load package: package example/newmath: import "example/newmath": cannot find package
这是否意味着我需要重置我的 $GOPATH/$GOROOT?我迷路了。
【问题讨论】: