Description
What version of Go, VS Code & VS Code Go extension are you using?
Version Information
-
Run
go version
to get version of Go from the VS Code integrated terminal.go version go1.18 linux/amd64
-
Run
gopls -v version
to get version of Gopls from the VS Code integrated terminal.-
---------- golang.org/x/tools/gopls v0.8.3 golang.org/x/tools/[email protected] h1:Mxm94ix8oSARQ6svioO6SxKEYWT/VCP54/448LOHzrk= github.com/BurntSushi/[email protected] h1:dtDWrepsVPfW9H/4y7dDgFc2MBUSeJhlaDtK13CxFlU= github.com/google/[email protected] h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/sergi/[email protected] h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= golang.org/x/exp/[email protected] h1:qyrTQ++p1afMkO4DPEeLGq/3oTsdlvdH4vqZUBWzUKM= golang.org/x/[email protected] h1:kQgndtyPBW/JIYERgdxfwMYh3AVStj88WQTlNDi2a+o= golang.org/x/[email protected] h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/[email protected] h1:rm+CHSpPEEW2IsXUib1ThaHIjuBVZjxNgSKmBLFfD4c= golang.org/x/[email protected] h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/[email protected] h1:rYiuK/jn6TCxjAq1hQ6MR6pgOeP3A5gIHDxgrQ8Vbys= golang.org/x/[email protected] h1:9dMzk88fnONra7zrEalqkRMGa9jMGf9B5mdzhYVyI28= golang.org/x/[email protected] h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= honnef.co/go/[email protected] h1:2LdYUZ7CIxnYgskbUZfY7FPggmqnh6shBqfWa8Tn3XU= mvdan.cc/[email protected] h1:kTojdZo9AcEYbQYhGuLf/zszYthRdhDNDUi2JKTxas4= mvdan.cc/xurls/[email protected] h1:tzxjVAj+wSBmDcF6zBB7/myTy3gX9xvi8Tyr28AuQgc= go: go1.18
-
-
Run
code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.-
da15b6fd3ef856477bf6f4fb29ba1b7af717770d x64
-
-
Check your installed extensions to get the version of the VS Code Go extension
- v0.33.0
-
Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) >
Go: Locate Configured Go Tools
command.-
GOBIN: undefined toolsGopath: gopath: /home/simon/go GOROOT: /opt/go PATH: /opt/go/bin:/home/simon/.local/bin:/home/simon/.cargo/bin:/home/simon/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/simon/.dotnet/tools:/home/simon/go/bin:/home/simon/go/bin PATH (vscode launched with): /opt/go/bin:/home/simon/.local/bin:/home/simon/.cargo/bin:/opt/go/bin:/home/simon/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/simon/.dotnet/tools:/home/simon/go/bin:/home/simon/go/bin go: /opt/go/bin/go: go version go1.18 linux/amd64 gotests: /home/simon/go/bin/gotests (version: v1.6.0 built with go: go1.18) gomodifytags: /home/simon/go/bin/gomodifytags (version: v1.16.0 built with go: go1.18) impl: /home/simon/go/bin/impl (version: v1.1.0 built with go: go1.18) goplay: /home/simon/go/bin/goplay (version: v1.0.0 built with go: go1.18) dlv: /home/simon/go/bin/dlv (version: v1.8.3 built with go: go1.18) staticcheck: /home/simon/go/bin/staticcheck (version: v0.3.1 built with go: go1.18) gopls: /home/simon/go/bin/gopls (version: v0.8.3 built with go: go1.18) go env Workspace Folder (salesforce): /home/simon/projects/nesto/backend/salesforce GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/home/simon/.cache/go-build" GOENV="/home/simon/.config/go/env" GOEXE="" GOEXPERIMENT="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/home/simon/go/pkg/mod" GONOPROXY="github.com/nestoca" GONOSUMDB="github.com/nestoca" GOOS="linux" GOPATH="/home/simon/go" GOPRIVATE="github.com/nestoca" GOPROXY="https://proxy.golang.org,direct" GOROOT="/opt/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/opt/go/pkg/tool/linux_amd64" GOVCS="" GOVERSION="go1.18" GCCGO="gccgo" GOAMD64="v1" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="/dev/null" GOWORK="/home/simon/projects/nesto/backend/salesforce/go.work" 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-build3049096489=/tmp/go-build -gno-record-gcc-switches" ```
-
Share the Go related settings you have added/edited
"gopls": {
"experimentalWorkspaceModule": true,
},
"go.toolsManagement.autoUpdate": true,
Describe the bug
Warnings in every file complaining about not being able to find imports, warnings on the field saying they are undefined. Editor is pretty much unusable.
We have a project with two go.mod files, we have a a folder called api
and a folder called integration/tests
in the project folder. Both of these have a go.mod in them. For about 10 months of so this setup was working perfectly with the experimentalWorkspaceModule
option. About a month or two ago these errors started occuring. I was hoping it was just a temporary error so I switched to using GoLand for a month or two hoping it would get fixed, but it still hasn't been fixed so I'm taking the time to open a ticket now.
I have tried clearing the cache, modcache, testcache, does not help.
Steps to reproduce the behavior:
I can't share out proprietary codehbase of course, so I recreated a dummy repo here with the same structure as our proprietary repo. I'm not able to replicate the error in the dummy repo at the moment. So it might not be that useful sadly.