我是Go的新手,我正在尝试以最少的文档建立一个Go项目:https : //github.com/alphagov/metadata-api
我已经克隆了它,但是当我尝试时go build
,收到以下警告:
main.go:8:2: cannot find package "github.com/Sirupsen/logrus" in any of:
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/github.com/Sirupsen/logrus (from $GOROOT)
/Users/me/go/src/github.com/Sirupsen/logrus (from $GOPATH)
main.go:14:2: cannot find package "github.com/alphagov/metadata-api/content_api" in any of:
/usr/local/Cellar/go/1.3.3/libexec/src/pkg/github.com/alphagov/metadata-api/content_api (from $GOROOT)
/Users/me/go/src/github.com/alphagov/metadata-api/content_api (from $GOPATH)
我猜这是因为我没有安装Go的等效要求?
我的GOPATH
位置:
metadata-api$ echo $GOPATH
/Users/me/go
Go可执行文件位于
metadata-ape$ echo $PATH
....:/Users/me/go/bin
我需要做什么来帮助Go查找这些软件包?
export PATH=$PATH:/Users/anna/go
,现在go build
不会产生任何错误...但是它似乎也不会产生任何东西。