Skip to content
Snippets Groups Projects

search: simplify defer functions

Created by: rvantonder

Found more of these based on @keegancsmith previous suggestion: https://github.com/sourcegraph/sourcegraph/pull/28449#discussion_r760842034

This is over all the code via:

comby 'defer func() { :[x.]() }()' 'defer :[x]()' .go -i  

There are other examples where we could remove the wrapping func() {...}() but in those cases I think it's not tasteful because the calls are larger expressions or close over arguments, so I just hit bodies that close over no arguments.

Merge request reports

Approval is optional

Merged by avatar (Sep 20, 2025 2:52am UTC)

Merge details

  • Changes merged into main with 4ea524d6.
  • Deleted the source branch.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading