drvpvmz16241016 2016-10-16 18:21
浏览 27

Glide管理的依赖项如何与构建一起使用?

I am using Go 1.7 and trying out Glide. The part I'm not getting is, Glide creates a vendor directory at $GOPATH/vendor. But when go builds it is looking for a vendor directory at $GOPATH/src/github.com/vendor/.../...

So I'm missing the part that happens between installing/updating dependencies and making them available to my program during a build.

  • 写回答

1条回答 默认 最新

  • dsbifvcxr458755493 2016-10-19 02:11
    关注

    Adding the answer for the next poor soul that comes along.

    If you're coming from the Java world, and you are used to the src directory being at the root of your project... Go says you are wrong. As the commenter indicated, your project path is $GOPATH/src/[github.com]/username/projectname and that is where you should do your "glide init".

    That will create the glide.yaml file in the correct spot so "glide install" will create the vendor directory at $GOPATH/src/githost/username/projectname/vendor and then your go builds will work as expected.

    Hopefully this will clear it up for other folks who might have similar questions.

    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?