Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Should users manually edit Gopkg.toml when adding a dependency? #989

Closed
F21 opened this issue Aug 11, 2017 · 6 comments
Closed

Should users manually edit Gopkg.toml when adding a dependency? #989

F21 opened this issue Aug 11, 2017 · 6 comments

Comments

@F21
Copy link

F21 commented Aug 11, 2017

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?

@sdboyer
Copy link
Member

sdboyer commented Aug 11, 2017

@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 😄

@F21
Copy link
Author

F21 commented Aug 11, 2017

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.

@sdboyer
Copy link
Member

sdboyer commented Aug 11, 2017

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

@F21
Copy link
Author

F21 commented Aug 11, 2017

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

@ibrasho
Copy link
Collaborator

ibrasho commented Aug 12, 2017

#994 is merged so this should be closed now. 👍

@F21
Copy link
Author

F21 commented Aug 12, 2017

Thanks @sdboyer !

@F21 F21 closed this as completed Aug 12, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants