drlndkhib08556095 2017-11-07 13:01
浏览 135
已采纳

go get首先失败,然后工作

The go command go get github.com/cloudnativego/gogo-service/service failed first, but then passed on the second run.

Entire sequence of events:

   [23:47]$ go get github.com/cloudnativego/gogo-service/service
    # cd /Users/../github.com/cloudnativego/gogo-service; git submodule update --init --recursive
    No submodule mapping found in .gitmodules for path 'vendor/github.com/cloudfoundry-community/go-cfenv'
    package github.com/cloudnativego/gogo-service/service: exit status 1
   [23:48]$ go get github.com/cloudnativego/gogo-service/service
   [23:49]$ #worked
   [23:49]$ ll vendor/github.com/
    total 0
    drwxr-xr-x  3 _  staff  102 Nov  2 22:48 .
    drwxr-xr-x  3 _  staff  102 Nov  2 22:48 ..
    drwxr-xr-x  3 _  staff  102 Nov  2 22:48 codegangsta
   [23:49]$

Is this a git issue or go get flakiness, or expected behavior?

  • 写回答

1条回答 默认 最新

  • du8442 2017-11-07 16:20
    关注

    This is caused by the repository in question using external libraries (in the vendor directory) as submodules, rather than as static vendoring, but not configuring those submodules within the .gitmodules file (which actually appears to be completely absent from that repo). There is a known issue with go get and submodules:

    You may be able to file an issue on the repository in question and suggest they move to a static vendoring model (or use govendor's fetch utility or similar with an ignored /vendor/*/ pattern). They aren't the first repo to run into this issue:

    Even github itself seems to generally recommend against using submodules anymore:

    https://github.com/blog/2104-working-with-submodules

    Before you add a repository as a submodule, first check to see if you have a better alternative available. Git submodules work well enough for simple cases, but these days there are often better tools available for managing dependencies than what Git submodules can offer.

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

报告相同问题?

悬赏问题

  • ¥15 飞机曲面部件如机翼,壁板等具体的孔位模型
  • ¥15 vs2019中数据导出问题
  • ¥20 云服务Linux系统TCP-MSS值修改?
  • ¥20 关于#单片机#的问题:项目:使用模拟iic与ov2640通讯环境:F407问题:读取的ID号总是0xff,自己调了调发现在读从机数据时,SDA线上并未有信号变化(语言-c语言)
  • ¥20 怎么在stm32门禁成品上增加查询记录功能
  • ¥15 Source insight编写代码后使用CCS5.2版本import之后,代码跳到注释行里面
  • ¥50 NT4.0系统 STOP:0X0000007B
  • ¥15 想问一下stata17中这段代码哪里有问题呀
  • ¥15 flink cdc无法实时同步mysql数据
  • ¥100 有人会搭建GPT-J-6B框架吗?有偿