dronthpi05943 2017-06-18 06:54
浏览 183
已采纳

“ glide get”和“ go get”安装不同的版本

I use ginkgo for the test tool, and glide for the package manager.

ginkgo requires that we install a binary to generate test files automatically. glide, to the best of my knowledge, does not support the installation of binaries. So, I ended up using go get to install the binary, along with its source files.

A problem is that glide installs all the packages that it resolves by scanning the go files. This means that the source files of ginkgo are also installed. During the compilation, the packages in vendor directory is prioritized. So this causes the situation where binary from $GOPATH/bin is used, and source files from vendor directory are used. And it seems that go get fetches files from master branch, where as glide fetches the latest released version. So the test files that are generated by the binary is not compatible with the source files installed by glide.

Is there any way to prevent glide from installing some specific packages? Or are there any other better ways?

  • 写回答

1条回答 默认 最新

  • doushui3216 2017-06-18 08:27
    关注

    With glide you can specify a certain version of the package you want to install. This is done in the glide.yaml

    TIP: The version is either VCS dependent and can be anything that can be checked out or a semantic version constraint that can be parsed by the github.com/ Masterminds/semver package. For example, with Git this can be a branch, tag, or hash. This varies and depends on what's supported in the VCS.

    package: github.com/YOUR/PACKAGE
    import:
      - package: github.com/onsi/ginkgo/ginkgo
        version: master
        repo: git@github.com:onsi/ginkgo.git
    

    This will download the latest master commit.

    Here are further information about versioning with glide.

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

报告相同问题?

悬赏问题

  • ¥15 Stata 面板数据模型选择
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用