Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proposal: go get https://* should work #35598

Closed
ivorscott opened this issue Nov 14, 2019 · 6 comments
Labels
Milestone

Comments

@ivorscott
Copy link

@ivorscott ivorscott commented Nov 14, 2019

What version of Go are you using (go version)?

$ go version go1.13 

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

go env Output
$ GO111MODULE=""
GOARCH="amd64"
GOBIN="/Users/ivorscott/Code/go/bin"
GOCACHE="/Users/ivorscott/Library/Caches/go-build"
GOENV="/Users/ivorscott/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/ivorscott/Code/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/ivorscott/Code/tutorials/jwt-go/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/q6/r0yhs73966jgct95tspm9m500000gn/T/go-build325006809=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

go get https://github.com/rs/zerolog

What did you expect to see?

go get https://github.com/rs/zerolog
go: finding github.com/rs/zerolog v1.16.0
go: downloading github.com/rs/zerolog v1.16.0
go: extracting github.com/rs/zerolog v1.16.0

What did you see instead?

go get https://github.com/rs/zerolog
go get https:/github.com/rs/zerolog: malformed module path "https:/github.com/rs/zerolog": invalid char ':'

Would be nice to see the http protocol allowed because often I am following a guide, or blog post and just copy/paste the repo url in the terminal. I think it's annoying to remove the protocol every time.

@ivorscott ivorscott changed the title go get https://* should work proposal: go get https://* should work Nov 14, 2019
@gopherbot gopherbot added this to the Proposal milestone Nov 14, 2019
@gopherbot gopherbot added the Proposal label Nov 14, 2019
@mvdan

This comment has been minimized.

Copy link
Member

@mvdan mvdan commented Nov 14, 2019

go get works on package paths. Those do not have an URL scheme, and this is on purpose. Would you also allow imports like import "https://github.com/rs/zerolog"?

@ivorscott

This comment has been minimized.

Copy link
Author

@ivorscott ivorscott commented Nov 14, 2019

I definitely wouldn't allow imports like import "https://github.com/rs/zerolog".

Only suggesting changes to the go get command.

Ignoring https:// would be cheap to do, and it's a nice experience because it's common practice for a developer to look up a github repository, then copy and paste its url to install it. Currently this fails hard and I think that's a bit unfortunate because the package path can still be determined.

@mvdan

This comment has been minimized.

Copy link
Member

@mvdan mvdan commented Nov 14, 2019

Sorry, but I disagree. Take https://github.com/mvdan/sh for example; the module's import path is mvdan.cc/sh/v3, not even close to github.com/mvdan/sh.

@ivorscott

This comment has been minimized.

Copy link
Author

@ivorscott ivorscott commented Nov 14, 2019

Ok nvm then.

I thought stripping out https:// would work in most cases and if the import path is not the same as the github repo url (no big deal), go get fails saying it can't find the package and a developer would just hit the docs for the correct installation command.

@bradfitz

This comment has been minimized.

Copy link
Member

@bradfitz bradfitz commented Nov 15, 2019

This has been proposed and declined a few times in the past.

Most recently: https://go-review.googlesource.com/c/go/+/205019

But at least once or twice before that as well. I can't find the proposal with GitHub's search now, though.

If somebody wants to find it, please link it. But I think we should probably close this.

@bcmills

This comment has been minimized.

Copy link
Member

@bcmills bcmills commented Nov 15, 2019

Duplicate of #12701

@bcmills bcmills marked this as a duplicate of #12701 Nov 15, 2019
@bcmills bcmills closed this Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.