HeadwindFly
HeadwindFly

Reputation: 884

How to get the specified version(tag) of package by using go get?

How to get the specified version(tag) of package by using go get?

go get github.com/owner/repo

In the above command, how to specify version or tag of the package.

Upvotes: 3

Views: 6263

Answers (1)

Plato
Plato

Reputation: 11052

Volker's correct, but here's a way to use a particular version in your project:

go get github.com/sirupsen/logrus
cd $GOPATH/src/github.com/sirupsen/logrus
git checkout v0.9.0
cd $GOPATH/src/github.com/YOU/PROJECT
govendor add github.com/sirupsen/logrus  # or similar

Upvotes: 6

Related Questions