-
Notifications
You must be signed in to change notification settings - Fork 18k
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
x/tools/gopls: make go.mod diagnostics on mismatched requirements available when go.work is used #48920
Comments
It looks like there's no easy way to make the Go command give us this information, short of running @matloob @bcmills do you think it would be possible to surface this error somewhere from |
We could in theory have the module loader error out if a package is loaded from some module in the workspace but doesn't
|
What version of Go are you using (
go version
)?What operating system and processor architecture are you using (
go env
)?go env
OutputGO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/Users/hakim/Library/Caches/go-build" GOENV="/Users/hakim/Library/Application Support/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOINSECURE="" GOMODCACHE="/Users/hakim/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="darwin" GOPATH="/Users/hakim/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/Users/hakim/sdk/gotip" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/Users/hakim/sdk/gotip/pkg/tool/darwin_amd64" GOVCS="" GOVERSION="devel go1.18-577bb7dba1 Mon Oct 11 17:02:03 2021 +0000" GCCGO="gccgo" GOAMD64="v1" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="/Users/hakim/vultest/tools/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 -arch x86_64 -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/bw/6r6k9d113sv1_vvzk_1kfxbm001py5/T/go-build3919035266=/tmp/go-build -gno-record-gcc-switches -fno-common"
What did you do?
Note
a/go.mod
is missingrequire
.What did you expect to see?
I hoped to see some sign or hint on incomplete
go.mod
(maybe suggests running some go commands with-workfile=off
?), but currentlygopls
andgo
commands are all happy becauseb
is importinggolang.org/x/tools/go/packages
.What did you see instead?
Incomplete
go.work
is not obvious.Tests & debugs run successfully thank to
go.work
.The text was updated successfully, but these errors were encountered: