我在 OSX 上使用 go 1.8.1
我的 GOPATH 是
/Users/alex/.gvm/pkgsets/go1.8.1/test-api:/Users/alex/.gvm/pkgsets/go1.8.1/global
我的文件夹结构是这样的(使用 gvm):
/Users/alex/.gvm/pkgsets/go1.8.1/test-api
├── bin
│ └── gvt
├── overlay
│ ├── bin
│ └── lib
│ └── pkgconfig
├── pkg
└── src
└── test-go-api -> /Users/alex/code/test-go-api
├── glide.lock
├── glide.yaml
├── main.go
├── models
│ └── state.go
└── vendor
├── github.com
├── golang.org
├── google.golang.org
└── gopkg.in
在我的 main.go 中,我导入
import (
"gopkg.in/kataras/iris.v6"
"gopkg.in/kataras/iris.v6/adaptors/httprouter"
"./models"
)
但是它大喊它找不到依赖项
main.go:4:2: cannot find package "gopkg.in/kataras/iris.v6" in any of:
/Users/alex/.gvm/gos/go1.8.1/src/gopkg.in/kataras/iris.v6 (from $GOROOT)
/Users/alex/.gvm/pkgsets/go1.8.1/test-api/src/gopkg.in/kataras/iris.v6 (from $GOPATH)
/Users/alex/.gvm/pkgsets/go1.8.1/global/src/gopkg.in/kataras/iris.v6
main.go:5:2: cannot find package "gopkg.in/kataras/iris.v6/adaptors/httprouter" in any of:
/Users/alex/.gvm/gos/go1.8.1/src/gopkg.in/kataras/iris.v6/adaptors/httprouter (from $GOROOT)
/Users/alex/.gvm/pkgsets/go1.8.1/test-api/src/gopkg.in/kataras/iris.v6/adaptors/httprouter (from $GOPATH)
/Users/alex/.gvm/pkgsets/go1.8.1/global/src/gopkg.in/kataras/iris.v6/adaptors/httprouter
有什么理由忽略我项目中的供应商文件夹?