[英]How to ignore file or path in golang lint tool in vscode
The problems shown on your screenshot are related to go vet
and not to golint
屏幕快照上显示的问题与go vet
,而不与golint
To pass an absolute path to go tool vet
or golint
do as follows: 要通过绝对路径来go tool vet
或golint
请执行以下操作:
File > Preferences > Settings
or hit Ctrl+,
转到File > Preferences > Settings
或Ctrl+,
"go.vetFlags"
or "go.lintFlags"
, ie "go.vetFlags": ["/path/to/file"]
将文件或目录路径添加到"go.vetFlags"
或"go.lintFlags"
,即"go.vetFlags": ["/path/to/file"]
For some reason, on go extension 0.6.78 it adds a .
出于某种原因,在扩展0.6.78中添加了.
argument to the go tool vet
(you can inspect it on OUTPUT tab in VSCode): go tool vet
参数(您可以在VSCode的OUTPUT选项卡上对其进行检查):
Finished running tool: /usr/local/go/bin/go tool vet /path/to/file .
which causes PROBLEMS tab to display messages regarding all the files in your workspace. 这会导致“问题”选项卡显示有关工作空间中所有文件的消息。
NOTE: also make sure go.lintOnSave
and go.vetOnSave
are set to package
and not workspace
. 注意:还要确保将go.lintOnSave
和go.vetOnSave
设置为package
而不是workspace
。 You can turn off any of them by setting it to off
您可以通过将其设置为off
来off
任何一个
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.