-
Notifications
You must be signed in to change notification settings - Fork 797
Error loading workspace in single .mod files repos #2347
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
Comments
Does the project compile with the updated go tool chain (i.e. from the workspace root directory, run |
@jamalc I reinstalled go again following the official docs, still the same error. When I try to compile from project root with If I run |
@morawskiOZ Do you encounter the problem if you remove the "go.buildTags" setting? I understand why you want it but it seems like gopls is currently not capable of handling the conflicts caused by adding There are multiple open issues in gopls related to better build tag supports |
Yes, that was it. Thank you @hyangah and @jamalc for all the help. Super weird that this showed up only after I bumped Go and all the tools to the newest version. Anyway, as there are already gopls related issues open I am closing this one. I hope this issue will help some poor soul in the future with the same problem ;) |
What version of Go, VS Code & VS Code Go extension are you using?
Version Information
go version
to get version of Go from the VS Code integrated terminal.gopls -v version
to get version of Gopls from the VS Code integrated terminal.golang.org/x/tools/gopls v0.9.1
golang.org/x/tools/[email protected] h1:SigsTL4Hpv3a6b/a7oPCLRv5QUeSM6PZNdta1oKY4B0=
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:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s=
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:Ljlba2fVWOA1049JjsKii44g8nZN2GjpxMlzVc8AnQM=
golang.org/x/[email protected] h1:r5bbIROBQtRRgoutV8Q3sFY58VzHW6jMBYl48ANSyS4=
honnef.co/go/[email protected] h1:ytYb4rOqyp1TSa2EPvNVwtPQJctSELKaMyLfqNP4+34=
mvdan.cc/[email protected] h1:kTojdZo9AcEYbQYhGuLf/zszYthRdhDNDUi2JKTxas4=
mvdan.cc/xurls/[email protected] h1:tzxjVAj+wSBmDcF6zBB7/myTy3gX9xvi8Tyr28AuQgc=
go: go1.18.4
code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.b06ae3b2d2dbfe28bca3134cc6be65935cdfea6a
x64
Go: Locate Configured Go Tools
command.GOBIN: undefined
toolsGopath:
gopath: /home/pm/go
GOROOT: /usr/local/go
PATH: /home/pm/.nvm/versions/node/v18.4.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/usr/local/go/bin:/home/pm/go/bin:/usr/local/go/bin:/home/pm/go/bin
go: /usr/local/go/bin/go: go version go1.18.4 linux/amd64
gotests: /home/pm/go/bin/gotests (version: v1.6.0 built with go: go1.18.4)
gomodifytags: /home/pm/go/bin/gomodifytags (version: v1.16.0 built with go: go1.18.4)
impl: /home/pm/go/bin/impl (version: v1.1.0 built with go: go1.18.4)
goplay: /home/pm/go/bin/goplay (version: v1.0.0 built with go: go1.18.4)
dlv: /home/pm/go/bin/dlv (version: v1.9.0 built with go: go1.18.4)
golint: /home/pm/go/bin/golint (version: v0.0.0-20210508222113-6edffad5e616 built with go: go1.18.4)
gopls: /home/pm/go/bin/gopls (version: v0.9.1 built with go: go1.18.4)
go env
Workspace Folder (binance-monitor): /home/pm/code/Github/binance-monitor
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/pm/.cache/go-build"
GOENV="/home/pm/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/pm/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/pm/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18.4"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/pm/code/Github/binance-monitor/go.mod"
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-build507315581=/tmp/go-build -gno-record-gcc-switches"
Share the Go related settings you have added/edited
Run
Preferences: Open Settings (JSON)
command to open your settings.json file.Share all the settings with the
go.
or["go"]
orgopls
prefixes.Describe the bug
After bumping go ver to 1.18.4 all my repos show this error:
Error loading workspace: err: exit status 1: stderr: go build syscall: package using cgo has Go assembly file asm_linux_amd64.s go build runtime: package using cgo has Go assembly file asm.s : packages.Load error
I 've updated every tool and pck I could but still no luck. I don't run multi packages repos so I am suprised I get workspace error.
Steps to reproduce the behavior:
Pretty sure it is only my setup problems (maybe some envs)
Screenshots or recordings
The text was updated successfully, but these errors were encountered: