diff options
author | Pavlo Strokov <pstrokov@gitlab.com> | 2021-08-03 10:52:03 +0300 |
---|---|---|
committer | Pavlo Strokov <pstrokov@gitlab.com> | 2021-08-09 11:15:05 +0300 |
commit | 0a05afdd8789ddcb43effe73b5db2d12cf88fd66 (patch) | |
tree | 7b6df384c61b105773328c1cd9afca99545a82c5 /cmd | |
parent | c61cdadb5838604164f75be508df6ef4f8538310 (diff) |
lint: Addressing omitted error handling
We should verify errors returned on the transaction
rollback. To prevent lint errors to be generated on
the future file changes we address it now. To simplify
transaction handling the new TxWrapper added. It prevents
duplicated Rollback or Commit invocations if some scheduled
with deferred call for cleanup.
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/praefect/subcmd_dataloss_test.go | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/cmd/praefect/subcmd_dataloss_test.go b/cmd/praefect/subcmd_dataloss_test.go index 07f4a26b4..038b71303 100644 --- a/cmd/praefect/subcmd_dataloss_test.go +++ b/cmd/praefect/subcmd_dataloss_test.go @@ -46,9 +46,8 @@ func TestDatalossSubcommand(t *testing.T) { }, } - tx, err := getDB(t).Begin() - require.NoError(t, err) - defer tx.Rollback() + tx := getDB(t).Begin(t) + defer tx.Rollback(t) ctx, cancel := testhelper.Context() defer cancel() |