Skip to content
This repository has been archived by the owner on Mar 29, 2022. It is now read-only.

Approach to vendoring dependencies #11

Closed
lucasgomide opened this issue Mar 23, 2017 · 5 comments
Closed

Approach to vendoring dependencies #11

lucasgomide opened this issue Mar 23, 2017 · 5 comments

Comments

@lucasgomide
Copy link
Contributor

To avoid troubles with dependencies versions, the Go team's recommended approach to vending dependencies [link].

We can use godep to make it..

wdyt?

@i4ki
Copy link
Contributor

i4ki commented Mar 29, 2017

Vendoring is for programs, not libraries.

@i4ki
Copy link
Contributor

i4ki commented Mar 29, 2017

But we do need to create a release version of wabbit!
:-)

The project is useful for you in the current state? If so, we can release the v1.0.

@lucasgomide
Copy link
Contributor Author

I believe that dependencies are dependencies..
So, any dependencies can to break for either programs or libraries. (As been happened on #7), or didn't ? Why should I vendoring for programs only ?

About to create a release, sgtm.

@i4ki
Copy link
Contributor

i4ki commented Mar 29, 2017

Libraries shall not vendor for several reasons, but the most important is that otherwise libraries could export in their APIs types from their own vendor directory making impossible (for example) to satisfy a library interface.
.
In other words, the library and the program importing a package like "golang/x/net/context" could end up referencing different packages (depending if a vendor dir exists or not in the library path).

You could get more information in the links below:
https://groups.google.com/forum/#!topic/golang-dev/4FfTBfN2YaI
https://groups.google.com/forum/#!topic/golang-nuts/AnMr9NL6dtc
etcd-io/etcd#4913

The general advice to avoid such problems is adding vendor only to programs. But the example you give to me is a real one. The go-dockerclient isn't used in our library, but only in the test program. When we run "go test", it builds a program that uses our library to test, than it's reasonable to vendor the libs used in tests (because it's a program).

go-dockerclient is a safe dependency to vendor in our side (no one will ever import it), but the streadway/amqp is not.

@lucasgomide
Copy link
Contributor Author

lucasgomide commented Mar 29, 2017

Perfect !!
I'll check your links

🚶🏻Ty @tiago4orion

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants