简体   繁体   中英

How do I use github packages in go?

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?

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.

Try go get with the verbose flag -v like:

go get -v github.com/danwakefield/fnmatch

This will show you more details. Post the result here.

we use Glide package management tool for GO. Go check it out gitHub link

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM