coverage: "illegal argument" vscode error from Go //line directive #2453
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
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 devel go1.20-d4ff25ac69 Thu Aug 25 11:40:57 2022 +0000 linux/amd64
Run
gopls -v version
to get version of Gopls from the VS Code integrated terminal.Build info
golang.org/x/tools/gopls v0.9.4
golang.org/x/tools/gopls@(devel)
github.com/BurntSushi/[email protected] h1:Rt8g24XnyGTyglgET/PRUNlrUeu9F5L+7FilkXfZgs0=
github.com/google/[email protected] h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
github.com/sergi/[email protected] h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
golang.org/x/exp/[email protected] h1:7Xs2YCOpMlNqSQSmrrnhlzBXIE/bpMecZplbLePTJvE=
golang.org/x/[email protected] h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s=
golang.org/x/[email protected] h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw=
golang.org/x/[email protected] h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s=
golang.org/x/[email protected] h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/[email protected] h1:b68wxF4nfQjj1XTRHtjVjCximbhAwjztuzDEFGU+n9o=
golang.org/x/[email protected] h1:BkeW9/QJhcigekDUPS9N9bIb0v7gPKKmLYeczVAqr2s=
honnef.co/go/[email protected] h1:ytYb4rOqyp1TSa2EPvNVwtPQJctSELKaMyLfqNP4+34=
mvdan.cc/[email protected] h1:avhhrOmv0IuvQVK7fvwV91oFSGAk5/6Po8GXTzICeu8=
mvdan.cc/xurls/[email protected] h1:tzxjVAj+wSBmDcF6zBB7/myTy3gX9xvi8Tyr28AuQgc=
go: devel go1.20-d4ff25ac69 Thu Aug 25 11:40:57 2022 +0000
code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) >
Go: Locate Configured Go Tools
command.Checking configured tools....
GOBIN: undefined
toolsGopath:
gopath: /ssd2/go1
GOROOT: /ssd2/go.master
PATH: /ssd2/go.master/bin:/ssd2/go1/bin:/ssd2/gobootstrap/bin:/usr/local/google/home/thanm/bin:/usr/lib/google-golang/bin:/usr/local/buildtools/java/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/ssd/gcc-trunk/cross/bin
go env
Workspace Folder (p): /ssd2/go1/src/github.com/thanm/nbt/cov-example/p
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/usr/local/google/home/thanm/.cache/go-build"
GOENV="/usr/local/google/home/thanm/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/ssd2/go1/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/ssd2/go1"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/ssd2/go.master"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/ssd2/go.master/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="devel go1.20-d4ff25ac69 Thu Aug 25 11:40:57 2022 +0000"
GCCGO="/ssd/gcc-trunk/cross/bin/gccgo"
GOAMD64="v1"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/ssd2/go1/src/github.com/thanm/nbt/cov-example/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 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build748014552=/tmp/go-build -gno-record-gcc-switches"
Share the Go related settings you have added/edited
Haven't changed the go settings (as far as I know).
Describe the bug
This is a problem with editing a package whose source code has a "//line" directive, resulting in an unexpected error from vscode. Details below:
Steps to reproduce the behavior:
This will result in this popup error:
The problematic construct in the package is in this function:
Note the line directive. If you remove this, things work properly.
The text was updated successfully, but these errors were encountered: