[英]Golang 1.6 Cannot find packages in vendor folder
I'm on go version 1.6.2 and am trying to go build
an application. 我正在使用1.6.2版,我正在尝试go build
一个应用程序。 Several dependencies are located inside the vendor
folder (eg vendor/docker/libcompose/
) but I get a cannot find package
when trying to load them. 几个依赖项位于vendor
文件夹内(例如vendor/docker/libcompose/
),但在尝试加载它时,我cannot find package
。
Here's an error message: 这是一条错误消息:
main.go:10:2: cannot find package "github.com/docker/libcompose/cli/command" in any of:
/usr/local/opt/go/libexec/src/github.com/docker/libcompose/cli/command (from $GOROOT)
/Users/ali/golang/src/github.com/docker/libcompose/cli/command (from $GOPATH)
What am I doing do wrong? 我做错了什么?
The doc says that packages put in the vendor
folder are loaded automatically. 该文档说,自动加载放在vendor
文件夹中的包。
Looking at your example, the folder structure is wrong. 看看你的例子,文件夹结构是错误的。 The package github.com/docker/libcompose
should be in vendor/github.com/docker/libcompose
not in vendor/docker/libcompose
. github.com/docker/libcompose
包应该在vendor/github.com/docker/libcompose
不在vendor/docker/libcompose
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.