doubingjiu3199 2017-02-20 16:30
浏览 109
已采纳

如何使Golint在VS Code上按类型而不是保存方式运行?

I am using VS Code and the Go extension from lukehoban:

https://github.com/Microsoft/vscode-go

It seems like the golint is run when you save the file, is there a way for me to make golint run when I start typing? Usually linting happens when we type on other extensions and languages such as jslint, and tslint on VS Code. It would be nice to have the option to also be able to do this with golint.

What could I do to achieve this?

  • 写回答

1条回答 默认 最新

  • douweinu8562 2017-02-21 18:13
    关注

    It seems like it's not possible at all.

    The only available configs regarding golint are:

      // Run Lint tool on save.
      "go.lintOnSave": true,
    
      // Specifies Lint tool name.
      "go.lintTool": "golint",
    
      // Flags to pass to Lint tool (e.g. ["-min_confidence=.8"])
      "go.lintFlags": [],
    

    Maybe you can hack this by changing these options though:

      // Controls auto save of dirty files. Accepted values:  "off", "afterDelay", "onFocusChange" (editor loses focus), "onWindowChange" (window loses focus). If set to "afterDelay", you can configure the delay in "files.autoSaveDelay".
      "files.autoSave": "off",
    
      // Controls the delay in ms after which a dirty file is saved automatically. Only applies when "files.autoSave" is set to "afterDelay"
      "files.autoSaveDelay": 1000,
    

    You could set files.autoSave to afterDelay and a lower files.autoSaveDelay.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 win10 LTSC 虚拟键盘不弹出
  • ¥30 微信小程序请求失败,网页能正常带锁访问
  • ¥15 对语音信号进行变调时,间接改变时序从而实现语音变速,进而将变调与变速同时实现、参数合成法换为波形合成法
  • ¥15 Python实现hog特征图可视化
  • ¥30 德飞莱51单片机实现C4炸弹
  • ¥50 CrossLink-LIF-MD6000 型 FPGA 的 CMOS 转 MIPI D-PHY IP 核功能使用异常
  • ¥15 proteus控制16x16LED点阵显示屏的设计
  • ¥30 求会做山景bp1048b2程序的。做直播声卡用
  • ¥15 求数学建模论文问题指导
  • ¥15 51单片机与数码管实现电子琴