dongyiyu882684 2017-08-03 20: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-03 21: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条)
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部