Skip to content

cmd/go: list module@version should suggest -m flag #50713

Open
@seankhliao

Description

@seankhliao

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

$ go version
go version devel go1.18-bb7fb8a5fa Wed Jan 19 21:46:55 2022 +0000 linux/amd64

Does this issue reproduce with the latest release?

yes

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

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/arccy/.cache/go-build"
GOENV="/home/arccy/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/arccy/.data/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/arccy/.data/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/arccy/sdk/gotip"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/arccy/sdk/gotip/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="devel go1.18-bb7fb8a5fa Wed Jan 19 21:46:55 2022 +0000"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
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-build4196401972=/tmp/go-build -gno-record-gcc-switches"

What did you do?

$ go list -f '{{ .Version }}' miniflux.app@686dd92cb9e486c41f407e93d2e10f6b4609f778
package miniflux.app@686dd92cb9e486c41f407e93d2e10f6b4609f778: can only use path@version syntax with 'go get' and 'go install' in module-aware mode

What did you expect to see?

An error message telling me I may have wanted go list -m ...

What did you see instead?

Error message only mentions go get and go install

cc @bcmills @matloob

Metadata

Metadata

Assignees

No one assigned

    Labels

    BadErrorMessageIssues related compiler error messages that should be better.GoCommandcmd/goNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions