Skip to content

search: simplify defer functions

Administrator requested to merge rvt/simplify-defer into main

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

Loading