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 list ./... in module mode with no packages results in two identical error messages #26925

Closed
myitcv opened this issue Aug 10, 2018 · 5 comments

Comments

Projects
None yet
4 participants
@myitcv
Copy link
Member

commented Aug 10, 2018

Please answer these questions before submitting your issue. Thanks!

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

go version devel +12d0a2884a Fri Aug 10 18:12:02 2018 +0000 linux/amd64

Does this issue reproduce with the latest release?

n/a: testing with tip.

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

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/myitcv/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/tmp/tmp.oN26clyGH0"
GOPROXY=""
GORACE=""
GOROOT="/home/myitcv/gos"
GOTMPDIR=""
GOTOOLDIR="/home/myitcv/gos/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/tmp/tmp.rffoceOlU2/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-build572056775=/tmp/go-build -gno-record-gcc-switches"

What did you do?

export GOPATH=$(mktemp -d)
cd $(mktemp -d)
mkdir hello
cd hello
go mod init example.com/hello
go list ./...

What did you expect to see?

warning: "./..." matched no packages

printed to stderr and zero exit code.

What did you see instead?

warning: "./..." matched no packages
warning: "./..." matched no packages

printed to stderr and zero exit code.

/cc @rsc @bcmills

@myitcv myitcv added the modules label Aug 10, 2018

@myitcv myitcv added this to the Go1.11 milestone Aug 10, 2018

@bcmills

This comment has been minimized.

Copy link
Member

commented Aug 10, 2018

That's related to the TODO here:

// TODO: Don't print warnings multiple times.

@bcmills

This comment has been minimized.

Copy link
Member

commented Aug 10, 2018

(And probably trivial to fix with a par.Cache.)

@rsc

This comment has been minimized.

Copy link
Contributor

commented Aug 10, 2018

I'm working on cleanup that will take care of this.

@gopherbot

This comment has been minimized.

Copy link

commented Aug 10, 2018

Change https://golang.org/cl/129058 mentions this issue: cmd/go: distinguish patterns from the results of matching them

@gopherbot

This comment has been minimized.

Copy link

commented Aug 10, 2018

Change https://golang.org/cl/129060 mentions this issue: cmd/go: report which patterns match each package in list

@gopherbot gopherbot closed this in d46587c Aug 17, 2018

gopherbot pushed a commit that referenced this issue Aug 17, 2018

cmd/go: report which patterns match each package in list
It's important for some uses of go/packages, as well as for some
of go/packages's internal use, to be able to tell which results from
go list output correspond to which patterns, keeping in mind that
a single package might have been matched by multiple patterns.

Also adds test for #26925.

Change-Id: I708ac162f65d9946fe6afb244b08dc7b04d2b530
Reviewed-on: https://go-review.googlesource.com/129060
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
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.