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

cmd/go: go get path@none results in error #26368

Closed
myitcv opened this issue Jul 13, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@myitcv
Copy link
Member

commented Jul 13, 2018

Please answer these questions before submitting your issue. Thanks!

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

go version devel +8a33045 Fri Jul 13 03:53:00 2018 +0000 linux/amd64

Does this issue reproduce with the latest release?

No, working with go tip.

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

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/ubuntu/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/tmp/tmp.Q82kVMHRrz"
GOPROXY=""
GORACE=""
GOROOT="/home/ubuntu/usr/gotip"
GOTMPDIR=""
GOTOOLDIR="/home/ubuntu/usr/gotip/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/tmp/tmp.Q82kVMHRrz/hello/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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build448197327=/tmp/go-build -gno-record-gcc-switches"

What did you do?

cd `mktemp -d`
export GOPATH=$PWD
mkdir hello
cd hello
vgo mod -init -module example.com/hello
go get rsc.io/quote
cat go.mod

gives:

module example.com/hello

require rsc.io/quote v1.5.2 // indirect

Then:

go get rsc.io/quote@none

What did you expect to see?

Successful removing of dependency, per go help mod:

The -require=path@version and -droprequire=path flags
add and drop a requirement on the given module path and version.
Note that -require overrides any existing requirements on path.
These flags are mainly for tools that understand the module graph.
Users should prefer 'go get path@version' or 'go get path@none',
which make other go.mod adjustments as needed to satisfy
constraints imposed by other modules.

What did you see instead?

go: finding rsc.io/quote none
go get rsc.io/quote@none: unknown revision none

@myitcv myitcv added the modules label Jul 13, 2018

@myitcv myitcv added this to the Go1.11 milestone Jul 13, 2018

@bcmills

This comment has been minimized.

Copy link
Member

commented Jul 13, 2018

Technically a dup of #26342, but yours is more precise and searchable. 🙂

(https://go-review.googlesource.com/c/vgo/+/122396/6/vendor/cmd/go/internal/modget/get.go#238)

@myitcv

This comment has been minimized.

Copy link
Member Author

commented Jul 13, 2018

Ha ha! Thanks, I'll close this 👍

@myitcv myitcv closed this Jul 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.