maronghe commented on code in PR #883:
URL:
https://github.com/apache/incubator-seata-go/pull/883#discussion_r2347058055
##########
pkg/datasource/sql/conn_at_test.go:
##########
@@ -238,3 +243,23 @@ func TestATConn_BeginTx(t *testing.T) {
assert.Equal(t, int32(1), atomic.LoadInt32(&comitCnt))
})
}
+
+type mockTxHook struct {
+ beforeCommit func(tx *Tx) error
+ beforeRollback func(tx *Tx)
+}
+
+// BeforeCommit
+func (mi *mockTxHook) BeforeCommit(tx *Tx) error {
+ if mi.beforeCommit != nil {
+ return mi.beforeCommit(tx)
+ }
+ return nil
+}
+
+// BeforeRollback
+func (mi *mockTxHook) BeforeRollback(tx *Tx) {
Review Comment:
need return error or not ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]