ahmetb / go-httpbin

http://httpbin.org endpoints for your Go tests
https://godoc.org/github.com/ahmetalpbalkan/go-httpbin
Apache License 2.0
124 stars 26 forks source link

Use glide for Go dependency management #11

Closed arschles closed 7 years ago

ahmetb commented 7 years ago

Ideally we'd like to use https://github.com/golang/dep but is it too early for that do you think?

Also the packages we use are fairly popular and they don't break often. More importantly these are somewhat common packages people probably already have in their GOPATH, I'm thinking if we'd run into diamond dependency issues by having a glide file declared at all.

arschles commented 7 years ago

@ahmetb IMO dep is probably too early right now. personally I'd wait until it's integrated into the toolchain in a future release. Also, although there are no guarantees yet, it looks like the file format between glide's and dep's will be fairly similar.

Regarding the commonality of the packages, I'd still recommend using glide to manage them as dependencies. Doing so will ensure the build stays consistent, even if HEAD on one of them changes (glide can pin deps to tags, commits, etc...)

Regarding the diamond dependency issue and people already having packages on their GOPATH, the toolchain will look first in the ./vendor directory (where glide puts dependencies) for each dependency package and stop if it finds it. The GOPATH is a backup to the vendor directory in this context.

Hope that helps

ahmetb commented 7 years ago

Sounds good. Would you like to update the CI steps as well, or should we keep them do go get ./...? If we keep as is, we can actually tell when an upstream tip breaks us (we had this before).

Since most (>90%) of people are probably not using glide, I think we will keep the project working with the latest versions of dependencies if they introduce breaking changes.

arschles commented 7 years ago

@ahmetb I'd definitely run CI steps against the glide versions (i.e. run glide install before running go test), but if you want to also check against the latest versions, we could run go test before glide install as well. thoughts?

ahmetb commented 7 years ago

It appears like we want to stay compatible with latest of dependencies, as well as support what's saved in glide.yaml. In this case, maybe we should run the tests twice, one with go get ./... and one after glide install. If you think this is the right approach, I appreciate a PR! :)

arschles commented 7 years ago

@ahmetb sounds like a good approach to me! Yes, I can submit a PR for that but may have to be tomorrow.