Closed ghostiam closed 3 years ago
I'll take a look at it this weekend. :open_hands: Thank you for the detailed report!
Updated examples and rules, and also added an example with interface implementation: https://gist.github.com/ghostiam/3c53ee547893e801662a8fb6087c9651
I solved this issue on my local branch, but my problem is: I can't reproduce this issue in tests. I would feel uncomfortable by sending a fix that would not have a good tests that would protect against regressions.
I also noted that in your examples there is an err
filter, but the pattern uses $x
instead.
But I can reproduce this issue in Docker tests. Locally, it doesn't want to be reproduced.
I have a solution, but it's ugly. I don't think I have a choice here though.
I can't write a rule that only finds methods from the logger and ignores
fmt.Errorf()
/etc. When using onlyWhere(m["log"].Type.Implements(`logrus.FieldLogger`))
I get panic.go version go1.15.3 darwin/amd64
rules:
example:
panic: