dougaimian1143 2016-07-21 00:47
浏览 82
已采纳

golang编译时间(静态代码分析)以检测格式字符串和参数之间的不匹配

I recently discovered that I have a lot of logging messages that the formatting string and the arguments are not an exact match. It seems by default (I am using go 1.6) the compiler does not report such issues.

Can I activate such check for go compile time validation or any other static code analysis tool to detect a mismatch between formatting string and arguments?

Note golint does not seem to report such issues as well.

  • 写回答

1条回答 默认 最新

  • dongqianwei6664 2016-07-21 01:07
    关注

    The vet command reports format string errors. The vet command is included in the Go 1.6 distribution.

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

报告相同问题?

悬赏问题

  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作