Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

go.vetFlags doesn't work #219

Closed
Lachee opened this issue Jun 13, 2020 · 2 comments
Closed

go.vetFlags doesn't work #219

Lachee opened this issue Jun 13, 2020 · 2 comments

Comments

@Lachee
Copy link

Lachee commented Jun 13, 2020

What version of Go, VS Code & VS Code Go extension are you using?

  • Run go version to get version of Go
    • go version go1.14.4 windows/amd64
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders
    • 1.46.0 a5d1cc28bb5da32ec67e86cc50f84c67cc690321 x64
  • Check your installed extensions to get the version of the VS Code Go extension
    • v0.14.4
  • Run go env to get the go development environment details
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\lachl\AppData\Local\go-build
set GOENV=D:\Users\Lachee\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\lachl\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=D:\ccache-src\links\gcc.exe
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\lachl\AppData\Local\Temp\go-build254906210=/tmp/go-build -gno-record-gcc-switches

Share the Go related settings you have added/edited

{
    "go.toolsEnvVars": {
        "GOOS": "js",
        "GOARCH": "wasm"
    },
    "go.vetFlags": [
        "-composites=false",
    ]
}

Describe the bug

go.vetFlags are ignored and composites do not get disabled. They are still visible in the Problems tab and highlighted in code (see screenshot). When manually running go vet -composites=false, not warnings are generated. Setting the vet to off doesn't work either.

I expect this setting to be respected by the vet and to disable the composite warning, removing it from the Problems tab.

Steps to reproduce the behavior:

  1. Clone https://github.com/lachee/noodle
  2. Open the cloned folder as a new workspace
  3. Open examples/app_nineslice.go
  4. See "composite literal uses unkeyed fields" warning littered everywhere.
  5. Update settings.json to include the -composites=false flag
  6. Note the warnings do not disappear, even after reset.
  7. Update settings.json to disable vet.
  8. Note the warnings do not disappear, even after reset.

Screenshots or recordings

screenshot of bug
(https://i.lu.je/2020/Code_4pFdoBX88A.png)

@Lachee Lachee changed the title g.vetFlags doesn't work go.vetFlags doesn't work Jun 13, 2020
@hyangah
Copy link
Contributor

hyangah commented Jun 13, 2020

@Lachee Even though not specified in the report, it looks like gopls is enabled (in the screenshot, the hover shows 'go.pkg.dev' which is currently a sign of gopls). Can you double check if "go.useLanguageServer": true is set in the user settings or the workspace settings?
Also, you can verify it with the existence of "Output" > "gopls" channel at the bottom right panel.

When the language server is enabled, please adjust the setting as mentioned in
#217 (comment)

@Lachee
Copy link
Author

Lachee commented Jun 13, 2020

@Lachee Even though not specified in the report, it looks like gopls is enabled (in the screenshot, the hover shows 'go.pkg.dev' which is currently a sign of gopls). Can you double check if "go.useLanguageServer": true is set in the user settings or the workspace settings?
Also, you can verify it with the existence of "Output" > "gopls" channel at the bottom right panel.

When the language server is enabled, please adjust the setting as mentioned in
#217 (comment)

Hello, this apparently was enabled in the User settings. Thank you for the response, this has solved the issue. Not sure if there is a design change or notice that could be added, or if its just something a user needs to be aware of.

Cheers.

@Lachee Lachee closed this as completed Jun 13, 2020
@golang golang locked and limited conversation to collaborators Jun 13, 2021
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

3 participants