Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
ykadowak committed Nov 21, 2023
1 parent b7e040a commit 9a088ac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion zerologlint.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,20 @@ func inspect(cd callDefer, set *map[posser]struct{}) {
for _, p := range f.Params {
if isZerologEvent(p) {
// check if this zerolog.Event as a parameter is dispatched in the function
// TODO: specifically, it can be dispatched in another function that is called in this function, and
// TODO: technically, it can be dispatched in another function that is called in this function, and
// this algorithm cannot track that. But I'm tired of thinking about that for now.
for _, b := range f.Blocks {
for _, instr := range b.Instrs {
switch v := instr.(type) {
case *ssa.Call:
if inspectDispatchInFunction(v.Common()) {
shouldReturn = false
break
}
case *ssa.Defer:
if inspectDispatchInFunction(v.Common()) {
shouldReturn = false
break
}
}
}
Expand Down

0 comments on commit 9a088ac

Please sign in to comment.