I'm trying to add a new package to my project with go modules. This package is using github.com/docker/docker/client and works fine outside of the project. When I run go mod vendor
it pulls docker client package of version v1.13.1 which does not have some of the methods I am using in my code, but in go modules it is tagged as latest. How do I make go mod use the truly latest version of a package?
When needed, more specific versions of dependencies can be chosen with commands such as
go get foo@v1.2.3
,go get foo@master
,go get foo@e3702bed2
, or by editinggo.mod
directly.
If you need the latest commit on the master
branch, use
go get github.com/docker/docker/client@master
In order to get the latest un-tagged version, you need to specify the commit tag you want to have when doing go get
go get github.com/docker/docker/client@[commit-hash]
Would recommend using a specific version (preferred tagged version, if not latest pseudo version instead of master). Having dependency versions locked down in the go.mod file ensures repeatability.
The latest version available in one of the go proxies is https://search.gocenter.io/github.com~2Fdocker~2Fdocker/info?version=v1.14.0-0.20190511020111-3998dffb806f