Skip to content

Handle returned zerolog events without false positives#30

Draft
Codex wants to merge 2 commits intomainfrom
codex/fix-false-positive-issue
Draft

Handle returned zerolog events without false positives#30
Codex wants to merge 2 commits intomainfrom
codex/fix-false-positive-issue

Conversation

@Codex
Copy link

@Codex Codex AI commented Feb 5, 2026

False positives were reported when functions returned *zerolog.Event without dispatching it themselves (e.g., return log.Info()).

  • Analyzer: Skip tracking zerolog events whose SSA value flows into a return, preventing dispatch warnings for returned events.
  • Tests: Added regression cases covering direct and named-return of *zerolog.Event.

Example:

func info() *zerolog.Event {
	return log.Info() // no dispatch warning
}
Original prompt

This section details on the original issue you should resolve

<issue_title>False positive when returned by function</issue_title>
<issue_description>Is this false positive?

func info() *zerolog.Event {
	return log.Info()
}
must be dispatched by Msg or Send method (zerologlint)
	return log.Info()

</issue_description>

Comments on the Issue (you are @codex[agent] in this section)

@ykadowak Can you provide a complete example? Like a link to the line in a repository. @ykadowak Thank you. I confirmed. It might take some time to fix this to be honest though.

@Codex Codex AI changed the title [WIP] Fix false positive in info function return Handle returned zerolog events without false positives Feb 5, 2026
@Codex Codex AI requested a review from ykadowak February 5, 2026 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

False positive when returned by function

2 participants