Closed
Description
What version of Go are you using (go version
)?
1.11
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (go env
)?
All
What did you do?
GO111MODULE=off go get github.com/google/go-github/v18/github
What did you expect to see?
Go downloads the library into my GOPATH ignoring the v8 suffix.
What did you see instead?
package github.com/google/go-github/v18/github: cannot find package "github.com/google/go-github/v18/github" in any of:
/usr/local/go/src/github.com/google/go-github/v18/github (from $GOROOT)
/Users/me/go/src/github.com/google/go-github/v18/github (from $GOPATH)
Summary
- Go's import paths are smart enough to ignore the v18 when GO111MODULE is turned off.
go install
is also smart enough to remove vX when installing a go binary.
What makes go-get an exception?
Impact
If things stay the same way, all libraries like github.com/google/go-github will have to have two instructions for their users to download their library. Something like this:
### Installation
With Go Modules:
go get github.com/google/go-github/v18/github
import "github.com/google/go-github/v18/github"
Without Go Modules:
go get github.com/google/go-github/github
import "github.com/google/go-github/github"
Of course, you don't need to do go-get with Go Modules but the point is all the same: having two different installation/import instructions.