-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
db: check tx.Rollback error / serrors: add Join (#4307)
Check returned error of tx.Rollback where this had previously just been a `defer tx.Rollback`. The errcheck linter (rightly) complains about this. The Rollback was previously also be called after a successful commit, in which case it would have returned the error `ErrTxDone`. Now, Rollback is only called in error cases. Not fixed the `defer tx.Rollback` pattern in colibri code, as this appears to be pretty much dead code by now. Add a `serrors.Join` helper function to make it easier to return multiple potential errors. This API is modeled closely after `errors.Join`, which will be available in the go standard library in the next release (go 1.20).
- Loading branch information
Showing
6 changed files
with
73 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters