x/tools/gopls: filter -o from build flags #58021
Labels
gopls/metadata
Issues related to metadata loading in gopls
gopls
Issues related to the Go language server, gopls.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Tools
This label describes issues relating to any tools in the x/tools repository.
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.Run
gopls -v version
to get version of Gopls from the VS Code integrated terminal.Run
code -v
orcode-insiders -v
to get version of VS Code or VS Code Insiders.97dec172d3256f8ca4bfb2143f3f76b503ca0534
x64
Check your installed extensions to get the version of the VS Code Go extension
Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) >
Go: Locate Configured Go Tools
command.Checking configured tools....
GOBIN: undefined
toolsGopath:
gopath: /home/oz/go
GOROOT: /opt/go
go: /usr/local/bin/go: go version go1.19.5 linux/amd64
gotests: not installed
gomodifytags: not installed
impl: not installed
goplay: not installed
dlv: not installed
staticcheck: not installed
gopls: /home/oz/go/bin/gopls (version: v0.11.0 built with go: go1.19.5)
go env
Workspace Folder (GoTestProgram): /mnt/c/Users/torst/git/blog/GoTestProgram
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/oz/.cache/go-build"
GOENV="/home/oz/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/oz/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/oz/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/opt/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/opt/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.19.5"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/mnt/c/Users/oz/git/blog/GoTestProgram/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-build2326393920=/tmp/go-build -gno-record-gcc-switches"
Share the Go related settings you have added/edited
{
"go.buildFlags": [
"-o=../build"
]
}
Describe the bug
I'd like to change the output directory by specifiying a build flag.
It works as expected, but VS Code always displays the following error:
This looks similar to the issue https://github.com/golang/vscode-go/issues/2248 - however, there, that error was justified, because the build flag was actually invalid. Here, the command does what it's supposed to do, but still displays an error.
Maybe it's relevant to mention that I'm using VS Code on Windows and Go in the WSL.
Steps to reproduce the behavior:
Screenshots or recordings
If applicable, add screenshots or recordings to help explain your problem.
The text was updated successfully, but these errors were encountered: