gopath

$ go run main/main.go
main/main.go:5:5: cannot find package "shopping" in any of:
        /usr/local/Cellar/go/1.9.2/libexec/src/shopping (from $GOROOT)
        /Users/evan/go/src/shopping (from $GOPATH)

fix:

$ export GOPATH=/Users/evan/go

注意,$GOPATH下必须是 src/ 目录,然后才是app的目录。

QY 20180116

你可能感兴趣的:(gopath)