尝试使用 1.5 版在 go lang 中构建我的项目并GO15VENDOREXPERIMENT="1"打开以确保我在本地寻找供应商。
我的结构是:
apps_api
main.go
build.sh
src
controllers
models
views
vendor
github.com
golang.org
.....
build.sh 包含
export GO15VENDOREXPERIMENT="1"
export GOPATH=`pwd`
go build .
控制器文件示例
import (
"models"
"views"
"github.com/gin-gonic/gin"
)
但是我收到很多错误,说找不到包,请参见下面的示例
src/controllers/app-versions.go:10:2: cannot find package "github.com/asaskevich/govalidator" in any of:
/Users/ereeve/.gvm/gos/go1.5/src/github.com/asaskevich/govalidator (from $GOROOT)
/Users/ereeve/Documents/gocode/src/apps_api/src/github.com/asaskevich/govalidator (from $GOPATH)
src/controllers/index.go:4:2: cannot find package "github.com/chnlr/baseurl" in any of:
/Users/ereeve/.gvm/gos/go1.5/src/github.com/chnlr/baseurl (from $GOROOT)
/Users/ereeve/Documents/gocode/src/apps_api/src/github.com/chnlr/baseurl (from $GOPATH)
如果我将这些行添加到我的 build.sh 文件中,它将构建,但我不想使用 go get 因为我在我的项目中使用 go 1.5 与本地供应商以避免依赖关系。
# go get github.com/gin-gonic/gin
# go get github.com/go-sql-driver/mysql
# go get github.com/rif/cache2go
....
任何想法我做错了什么?
收到一只叮咚
相关分类