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.

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

报告相同问题?