dongyiyu882684 2017-08-04 04:28
浏览 490
已采纳

如何在Go中使用github包?

Sorry, very much a newbie golang question. I have a github project named journalbeat that I am modifying.

When I clone that repository I can set the GOPATH and run go get to grab all the imports and it places them into src.

I have a new import I want to add.

import "github.com/danwakefield/fnmatch"

but it doesn't grab it. How does simply running go get determine whether something is downloaded or not?

And finally, the vendoring system is used. How do I populate that with the fnmatch? do I create it manually? it all seems very cumbersome.

I thought go get was meant to make all this easy?

  • 写回答

3条回答 默认 最新

  • doumeng4400 2017-08-04 05:02
    关注

    Try instead a dependency manager: the most recent and actively developed one is golang/dep.
    Reading dep "issue" 943, use:

    dep ensure
    

    That will set up vendored dependencies through import analysis, and you can configure locking those down if need be.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 有偿求苍穹外卖环境配置
  • ¥15 代码在keil5里变成了这样怎么办啊,文件图像也变了,
  • ¥20 Ue4.26打包win64bit报错,如何解决?(语言-c++)
  • ¥15 clousx6整点报时指令怎么写
  • ¥30 远程帮我安装软件及库文件
  • ¥15 关于#自动化#的问题:如何通过电脑控制多相机同步拍照或摄影(相机或者摄影模组数量大于60),并将所有采集的照片或视频以一定编码规则存放至规定电脑文件夹内
  • ¥20 深信服vpn-2050这台设备如何配置才能成功联网?
  • ¥15 Arduino的wifi连接,如何关闭低功耗模式?
  • ¥15 Android studio 无法定位adb是什么问题?
  • ¥15 C#连接不上服务器,