Search code examples
dockergogo-modules

Go modules pulls old version of a package


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?


Solution

  • Go Wiki: Modules:

    When needed, more specific versions of dependencies can be chosen with commands such as go get [email protected], go get foo@master, go get foo@e3702bed2, or by editing go.mod directly.

    If you need the latest commit on the master branch, use

    go get github.com/docker/docker/client@master