8000 cmd/go: should go get deduce semantic import versioning when GO111MODULE is off? · Issue #27430 · golang/go · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
cmd/go: should go get deduce semantic import versioning when GO111MODULE is off? #27430
Closed
@marwan-at-work

Description

@marwan-at-work

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

  1. Go's import paths are smart enough to ignore the v18 when GO111MODULE is turned off.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.modules

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0