govscode-extensions

Invalid settings: setting option "vulncheck": invalid option "Prompt" for enum


the default option of go.diagnostic.vulncheck

it's warning "Invalid settings: setting option "vulncheck": invalid option "Prompt" for enum".

haven't find any other description about it, but only got this ->


`go.diagnostic.vulncheck`

(Experimental) vulncheck enables vulnerability scanning.  
Allowed Options:

- `Imports`: `"Imports"`: In Imports mode, `gopls` will report vulnerabilities that affect packages directly and indirectly used by the analyzed main module.

- `Off`: `"Off"`: Disable vulnerability analysis.

- `Prompt`: `"Prompt"`: Vulncheck can be triggered via prompt.

Default: `"Prompt"`


Solution

  • Check this page: https://github.com/golang/vscode-go/wiki/settings

    Press Ctrl+Shift+P, open User Settings (JSON), and if you want to enable vulnerability diagnostics for imported packages, add:

    "go.diagnostic.vulncheck": "Imports"
    

    If you don’t, use:

    "go.diagnostic.vulncheck": "Off"