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/toml@v1.2.0 h1:Rt8g24XnyGTyglgET/PRUNlrUeu9F5L+7FilkXfZgs0=
github.com/google/go-cmp@v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
golang.org/x/exp/typeparams@v0.0.0-20220722155223-a9213eeb770e h1:7Xs2YCOpMlNqSQSmrrnhlzBXIE/bpMecZplbLePTJvE=
golang.org/x/mod@v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s=
golang.org/x/sync@v0.0.0-20220722155255-886fb9371eb4 h1:uVc8UZUe6tr40fFVnUP5Oj+veunVezqYl9z7DYw9xzw=
golang.org/x/sys@v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s=
golang.org/x/text@v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
golang.org/x/tools@v0.1.13-0.20220812184215-3f9b119300de h1:b68wxF4nfQjj1XTRHtjVjCximbhAwjztuzDEFGU+n9o=
golang.org/x/vuln@v0.0.0-20220725105440-4151a5aca1df h1:BkeW9/QJhcigekDUPS9N9bIb0v7gPKKmLYeczVAqr2s=
honnef.co/go/tools@v0.3.2 h1:ytYb4rOqyp1TSa2EPvNVwtPQJctSELKaMyLfqNP4+34=
mvdan.cc/gofumpt@v0.3.1 h1:avhhrOmv0IuvQVK7fvwV91oFSGAk5/6Po8GXTzICeu8=
mvdan.cc/xurls/v2@v2.4.0 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: