Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorPavlo Strokov <pstrokov@gitlab.com>2021-08-03 10:52:03 +0300
committerPavlo Strokov <pstrokov@gitlab.com>2021-08-09 11:15:05 +0300
commit0a05afdd8789ddcb43effe73b5db2d12cf88fd66 (patch)
tree7b6df384c61b105773328c1cd9afca99545a82c5 /cmd
parentc61cdadb5838604164f75be508df6ef4f8538310 (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.go5
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()