我正在检查供应商功能。安装所有软件包真棒,但我无法让命令在供应商软件包中找到它们。
go run src/main.go
src/main.go:8:2: cannot find package "github.com/valyala/fasthttp" in any of:
/home/joaonrb/.software/lib/go/go1.7/src/github.com/valyala/fasthttp (from $GOROOT)
/home/joaonrb/.projects/go-blog/src/github.com/valyala/fasthttp (from $GOPATH)
Fasthttp安装在/home/joaonrb/.projects/go-blog/src/vendor/github.com/valyala/fasthttp
中,我使用的版本是1.7,我的GOPATH是/home/joaonrb/.projects/go-blog
答案 0 :(得分:6)
您的GOPATH结构似乎无效。做你想做的事:
$GOPATH/src/myproj
。$GOPATH/src/myproj/vendor
。github.com/valyala/fasthttp
放在那里。这应该有效。