简体   繁体   English

Golang 1.6无法在供应商文件夹中找到包

[英]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

See more here . 在这里查看更多。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM