diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2024-03-08 15:32:50 +0100 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2024-03-12 11:14:34 +0000 |
| commit | 5d97b658d9c2ec0cd68e5632ce7f11bfe5d6c282 (patch) | |
| tree | e9cd31ca03ae971662131fcc86a12b0be2e0d227 /tools | |
| parent | 47e31070c5773a0916c6bb7fd0602594d9c1a53a (diff) | |
tools/syz-linter: check all Logf calls
We have a variety of T.Logf() methods, while in most cases there's no
need to add signatures of each individual method to the syz-linter.
Co-authored-by: Dmitry Vyukov <dvyukov@google.com>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/syz-linter/linter.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/syz-linter/linter.go b/tools/syz-linter/linter.go index d0cd0879b..76168c7c9 100644 --- a/tools/syz-linter/linter.go +++ b/tools/syz-linter/linter.go @@ -252,7 +252,7 @@ func (pass *Pass) checkFlagDefinition(n *ast.CallExpr) { // checkLogErrorFormat warns about log/error messages starting with capital letter or ending with a period. func (pass *Pass) checkLogErrorFormat(n *ast.CallExpr) { arg, newLine, sure := pass.logFormatArg(n) - if arg == -1 { + if arg == -1 || len(n.Args) <= arg { return } val, ok := stringLit(n.Args[arg]) @@ -302,6 +302,9 @@ func (pass *Pass) logFormatArg(n *ast.CallExpr) (arg int, newLine, sure bool) { } return 1, true, true } + if fun.Sel.String() == "Logf" { + return 1, false, true + } return -1, false, false } |
