-
Notifications
You must be signed in to change notification settings - Fork 770
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
x/tools/gopls: filter -o from go list invocation #1561
Comments
Change https://golang.org/cl/325889 mentions this issue: |
@squeeze69 What is the goal of adding If your goal is to run |
Hi, it could be an interesting workaround, thanks, but the current settings were ok before a go plugin update (I really don't remember when it stopped working). BTW, IMHO, every build flag accepted by the build command should be allowed, not a subset common to go list, etc... Maybe a filter would be enough? Or a new setting go.testBuildFlags which override go.buildFlags in test cases (only if present, of course)? |
I admit it's confusing - |
Please answer these questions before submitting your issue. Thanks!
What version of Go, VS Code & VS Code Go extension are you using?
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.Commit: 054a9295330880ed74ceaedda236253b4f39a335
Data: 2021-05-12T17:13:13.157Z
Electron: 12.0.4
Chrome: 89.0.4389.114
Node.js: 14.16.0
V8: 8.9.255.24-electron.0
Sistema operativo: Windows_NT x64 6.1.7601
Check your installed extensions to get the version of the VS Code Go extension
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.{
"settings": {
"go.toolsEnvVars": {
"GOOS": "js",
"GOARCH": "wasm",
"GO111MODULE":"off"
},
"go.buildFlags": ["-o='built/output.wasm'"]
}
}
Describe the bug
Starting vscode with a go project with a workspace including: "go.buildFlags": ["-o='built/output.wasm'"] the go extension complains that "go list" doesn't support the "-o" flag.
The error is:
Error loading workspace: err: exit status 2: stderr: flag provided but not defined: -o usage: go list [-f format] [-json] [-m] [list flags] [build flags] [packages] Run 'go help list' for details. : packages.Load error
A clear and concise description of what you expected to happen.
...I'd expect the workspace to load w/o any complain, since the "-o" flag should be used in "go build"
The text was updated successfully, but these errors were encountered: