This question has been asked here a number of times, but the last time a 
few months ago: are there any plans to add support for package versioning 
(understanding VCS tags in the import paths), that is to teach `go get` to 
pull specified version (tag) of the package rather than the most recent 
version? As an alternative to storing packages in /vendor.

My suggestion would be similar to Mr. McVetta's in 
https://groups.google.com/forum/#!searchin/golang-nuts/package$20versioning%7Csort:relevance/golang-nuts/-65WPrNcT3U/5w1mkmE-4BsJ,
 
but specifying the version as a comment tag rather than in the import path. 
This should be sufficient to prevent importing two different versions of 
the same package.

import (
        ...
        "github.com/spf13/cobra" // v0.8.0 
        "github.com/spf13/viper" // v1.10.0
)

Alternatively (less likely to be mixed with a regular comment in the legacy 
code):
"github.com/spf13/viper" // `v1.10.0`
"github.com/spf13/viper" // +v1.10.0
"github.com/spf13/viper" // +tag v1.10.0

And an update for the `go get`:
$ go get -u -tag=v1.10.0 github.com/spf13/viper


-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to