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 有赏,i卡绘世画不出
  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码