即使我已经正确地设置了 GOPATH
,我仍然不能得到“构建”或“运行”来找到我自己的软件包。我做错了什么?
$ echo $GOROOT
/usr/local/go
$ echo $GOPATH
/home/mitchell/go
$ cat ~/main.go
package main
import "foobar"
func main() { }
$ cat /home/mitchell/go/src/foobar.go
package foobar
$ go build main.go
main.go:3:8: import "foobar": cannot find package