Skip to content

Commit

Permalink
add dispatch methods
Browse files Browse the repository at this point in the history
  • Loading branch information
ykadowak committed Mar 26, 2023
1 parent 0a2a04b commit 011a5aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions testdata/src/a/a.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,8 @@ func ok() {
logger2 = log.Error()
}
logger2.Send()

// dispatch variation
log.Info().Msgf("")
log.Info().MsgFunc(func() string { return "foo" })
}
2 changes: 1 addition & 1 deletion zerologlint.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func isZerologEvent(v ssa.Value) bool {

func isDispatchMethod(c *ssa.Call) bool {
m := c.Common().StaticCallee().Name()
if m == "Send" || m == "Msg" {
if m == "Send" || m == "Msg" || m == "Msgf" || m == "MsgFunc" {
return true
}
return false
Expand Down

0 comments on commit 011a5aa

Please sign in to comment.