Dep: Should users manually edit Gopkg.toml when adding a dependency?

Created on 11 Aug 2017  路  6Comments  路  Source: golang/dep

The instructions say that when adding a dependency, we should import the code and run dep ensure.

Should we edit Gopkg.toml to include the new dependency as well?

ensure

Most helpful comment

Oh, cool. That makes sense! 馃槃 Hope that makes it into dep soon. Other than that, dep has been working super well for us 馃憤

All 6 comments

@F21 that's one acceptable path, but things are a bit different now, with the introduction of dep ensure -add. that's probably going to be an easier path for most people, most of the time.

i will update the README tonight 馃槃

I just added a dependency using dep ensure -add github.com/someorg/someproject/somepkg, but while Gopkg.lock was updated, the dependency was not added to Gopkg.toml.

In my case, I was trying to add github.com/someorg/someproject/somepkg, since someproject did not have any Go code in the repository's root. However, Gopkg.lock was updated correctly to import github.com/someorg/someproject with the relevant tag.

Yep, you're right in this hole. when that branch is implemented, it'll pick a constraint and append it into Gopkg.toml based on the version that was selected for Gopkg.lock.

i considered waiting to merge #489 for it, but i decided to defer it, as things had already taken so long.

this reminds me, though, that it should probably be one of our highest priority things on ensure right now /cc @ibrasho

Oh, cool. That makes sense! 馃槃 Hope that makes it into dep soon. Other than that, dep has been working super well for us 馃憤

994 is merged so this should be closed now. :+1:

Thanks @sdboyer !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sdboyer picture sdboyer  路  31Comments

godcong picture godcong  路  27Comments

mastoj picture mastoj  路  29Comments

davecheney picture davecheney  路  32Comments

sdboyer picture sdboyer  路  40Comments