duanliaogui4133 2017-02-09 00:57
浏览 29
已采纳

Glide软件包管理器用法

I'm using Glide to manage my golang dependencies, but when trying to build my project on a clean environment, the vendor directory is being ignore:

./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

All the vendor deps are there

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

11 directories

but my project still ignores the vendor dir:

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)

I don't think I need to set GOVENDOREXPERIMENT because I'm using go1.7.4

  • 写回答

1条回答 默认 最新

  • doumubi6784 2017-02-09 05:31
    关注

    Very stupid really, the git repo also needs to be in the$GOPATH. I symlinked my repo to $GOPATH/src/github.com/vendor/project and everything worked.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 MATLAB中streamslice问题
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 51单片机中C语言怎么做到下面类似的功能的函数(相关搜索:c语言)
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序