Skip to content

cmd/get: path@version syntax rejected despite $GOPATH not set #29575

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

Closed
ahmetb opened this issue Jan 4, 2019 · 1 comment
Closed

cmd/get: path@version syntax rejected despite $GOPATH not set #29575

ahmetb opened this issue Jan 4, 2019 · 1 comment

Comments

@ahmetb
Copy link

ahmetb commented Jan 4, 2019

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

$ go version
go version go1.11.4 darwin/amd64

Does this issue reproduce with the latest release?

Yes (go1.11.4)

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

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/ahmetb/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/ahmetb/go"
GOPROXY=""
GORACE=""
GOROOT="/Users/ahmetb/.homebrew/Cellar/go/1.11.4/libexec"
GOTMPDIR=""
GOTOOLDIR="/Users/ahmetb/.homebrew/Cellar/go/1.11.4/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
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/76/5g_jbgjn6xg_jkwcm2n_m52r00dl55/T/go-build263455237=/tmp/go-build -gno-record-gcc-switches -fno-common"
  • ⚠️ Also, echo $GOPATH prints nothing in my shell.

What did you do?

Tried to go-get a package that contains a main, without $GOPATH set.

$ go get github.com/rakyll/hey@v0.1.1

What did you expect to see?

  • download package at v0.1.1
  • build
  • install at ~/go/bin/hey

What did you see instead?

$ go get github.com/rakyll/hey@v0.1.1
go: cannot use path@version syntax in GOPATH mode

but I'm not in $GOPATH mode?


Aside: Right now I'm observing:

  1. despite GOPATH not set, go-get cannot be used to download commands anymore if you're specifying path@version syntax.

  2. with go1.11, you can't download commands with go-get to a custom path like you did in env GOPATH=/a/b go get github.com/foo && a/b/foo pre go1.11.

@ahmetb
Copy link
Author

ahmetb commented Jan 4, 2019

Dupe of #29415 argh.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants