Closed calvn closed 8 years ago
When a repo is git pushed to remote that has no source, how will that remote build the source w/o hitting the network?
If you are looking for that feature, please see govendor. PS: If you migrate to govendor, please don't use it's migrate command. I suggest instead doing:
$ godep restore
$ rm -rf Godeps vendor
$ govendor init
$ govendor add +ex
Your point is fair, but I think that git-ignoring vendor/
should be an option. godep restore
should try to fetch remote dependencies if vendor/
is absent before showing failure due to network, if there is one. If vendor/
is already present, then simply skip that step. I think giving users the option is better than excluding it entirely.
Edit: I just dug deeper into this and saw #123 and #131 along with the proposal to remove such feature.
@cleung2010 godep restore
doesn't use the contents of vendor/
it's sole job is to fetch what is described in Godeps.json
into $GOPATH
.
I am not all too familiar with the inner-workings of dependency resolution for Go, so I wanted to know the reason behind the need to (git) include
vendor/
in a Go project. Ifgo restore
would perform the vendoring before installing the packages in$GOPATH
I think there would be no need to commit dependency sources into the project.On
npm
, for instance, you would commit thepackage.json
which has references (among other things) to all the dependencies that the package needs, but you don't commitnode_pacakges
which is what contains the source.npm install
on the project would do the job of fetching all the dependencies. I was hoping for something similar ongodep
, which would make projects much lighter.