Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/go/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Go Glide包管理器的使用_Go_Glide Golang - Fatal编程技术网

Go Glide包管理器的使用

Go Glide包管理器的使用,go,glide-golang,Go,Glide Golang,我正在使用来管理我的golang依赖项,但在尝试在干净的环境中构建项目时,供应商目录被忽略: ./glide install [INFO] Downloading dependencies. Please wait... [INFO] --> Found desired version locally github.com/dustin/go-humanize 7a41df006ff9af79a29f0ffa9c5f21fbe6314a2d! [INFO] --> Found

我正在使用来管理我的golang依赖项,但在尝试在干净的环境中构建项目时,
供应商
目录被忽略:

./glide install
[INFO]  Downloading dependencies. Please wait...
[INFO]  --> Found desired version locally github.com/dustin/go-humanize 7a41df006ff9af79a29f0ffa9c5f21fbe6314a2d!
[INFO]  --> Found desired version locally github.com/jaxxstorm/flexvolume b65378104ef0f49af77d6f73d87da7e78d0f8252!
[INFO]  --> Found desired version locally github.com/kolyshkin/goploop-cli 5365b446a713e31ac4f2026b05a6dac27bbdf21c!
[INFO]  --> Found desired version locally github.com/urfave/cli 0bdeddeeb0f650497d603c4ad7b20cfe685682f6!
[INFO]  Setting references.
[INFO]  --> Setting version for github.com/kolyshkin/goploop-cli to 5365b446a713e31ac4f2026b05a6dac27bbdf21c.
[INFO]  --> Setting version for github.com/dustin/go-humanize to 7a41df006ff9af79a29f0ffa9c5f21fbe6314a2d.
[INFO]  --> Setting version for github.com/urfave/cli to 0bdeddeeb0f650497d603c4ad7b20cfe685682f6.
[INFO]  --> Setting version for github.com/jaxxstorm/flexvolume to b65378104ef0f49af77d6f73d87da7e78d0f8252.
[INFO]  Exporting resolved dependencies...
[INFO]  --> Exporting github.com/urfave/cli
[INFO]  --> Exporting github.com/jaxxstorm/flexvolume
[INFO]  --> Exporting github.com/dustin/go-humanize
[INFO]  --> Exporting github.com/kolyshkin/goploop-cli
[INFO]  Replacing existing vendor dependencies
所有的供应商部门都在那里

vendor
└── github.com
    ├── dustin
    │   └── go-humanize
    ├── jaxxstorm
    │   └── flexvolume
    ├── kolyshkin
    │   └── goploop-cli
    └── urfave
        └── cli
            ├── altsrc
        └── autocomplete
11个目录

但我的项目仍然忽略了供应商目录:

go build -o ploop main.go
    main.go:4:2: cannot find package "github.com/jaxxstorm/flexvolume" in any of:
        /usr/lib/golang/src/github.com/jaxxstorm/flexvolume (from $GOROOT)
        /tmp/go/src/github.com/jaxxstorm/flexvolume (from $GOPATH)
    main.go:7:2: cannot find package "github.com/kolyshkin/goploop-cli" in any of:
        /usr/lib/golang/src/github.com/kolyshkin/goploop-cli (from $GOROOT)
        /tmp/go/src/github.com/kolyshkin/goploop-cli (from $GOPATH)
    main.go:8:2: cannot find package "github.com/urfave/cli" in any of:
        /usr/lib/golang/src/github.com/urfave/cli (from $GOROOT)
        /tmp/go/src/github.com/urfave/cli (from $GOPATH)

我不认为我需要设置
govendoreaction
,因为我使用的是
go1.7.4

真的很愚蠢,git回购也需要在
$GOPATH
中。我用符号将我的回购链接到了
$GOPATH/src/github.com/vendor/project
,一切都正常了。

你不是在构建一个包,你只是在构建一个文件。通过导入路径或从主程序包目录中生成或安装程序包。对不起,这里没有说明。请键入
go-Build-full/import/path
,或者从项目中键入
go-Build
。恐怕没有什么区别:(不要在GOPATH中使用符号链接。在许多情况下,符号链接会被构建工具忽略。只需按照文档操作即可: