We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
%T
1 parent f944ff4 commit bc40a42Copy full SHA for bc40a42
go/ql/lib/semmle/go/Concepts.qll
@@ -367,8 +367,11 @@ class LoggerCall extends DataFlow::Node instanceof LoggerCall::Range {
367
DataFlow::Node getAValueFormattedMessageComponent() {
368
result = this.getAMessageComponent() and
369
not exists(string formatSpecifier |
370
- formatSpecifier.regexpMatch("%[^%]*T") and
371
- result = this.(StringOps::Formatting::StringFormatCall).getOperand(_, formatSpecifier)
+ result = this.(StringOps::Formatting::StringFormatCall).getOperand(_, formatSpecifier) and
+ // We already know that `formatSpecifier` starts with `%`, so we check
372
+ // that it ends with `T` to confirm that it is `%T` or possibly some
373
+ // variation on it.
374
+ formatSpecifier.matches("%T")
375
)
376
}
377
0 commit comments