go - 没有文件保存在 VSCode 中的实时错误/警告

标签 go visual-studio-code

VSCode 只能在我为 Go 保存文件后报告语法错误/警告。此行为不同于其他语言,例如 dart .我可以在 Go 中有实时错误/警告吗?

最佳答案

我找到了解决方案。

基本上将以下内容添加到用户设置 (settings.json):

"go.liveErrors": {
  "enabled": true,
  "delay": 500
}

然后 VSCode 会要求您安装 gotype-live 工具。如果需要,您也可以使用以下命令手动安装:

go get -v github.com/tylerb/gotype-live

关于go - 没有文件保存在 VSCode 中的实时错误/警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56440524/

相关文章:

azure - 使用 Go 的 Azure ServiceBus 队列的 OpenTelemetry 传播问题

debugging - VS Code - 在 Laravel 项目中调试 VUE 组件 - 未验证的断点

visual-studio-code - VS Code Key Binding快速切换终端屏幕?

python - 我在 IDE 中运行了完全相同的 numpy python 代码,结果却不同。这怎么可能?

visual-studio-code - 如何在 VSCode 中选择整行

go - 你如何在 Go YAML 中编码换行符?

unit-testing - 如何使用 Go 日志包 glog 测试代码?

algorithm - 在 Go 中将 map 转换为树

go - Golang反射: Inspect a struct type definition to extract its properties without initialization

node.js - 可以将 Visual Studio Code 配置为使用 nodemon 启动吗