Skip to content

Commit 48b5c57

Browse files
committed
More comment
1 parent e1434d9 commit 48b5c57

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

models/db/context.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ func TxContext(parentCtx context.Context) (*Context, Committer, error) {
105105
var ErrAlreadyInTransaction = errors.New("database connection has already been in a transaction")
106106

107107
// WithTx represents executing database operations on a transaction
108+
// This function will always open a new transaction, if a transaction exist in parentCtx return an error.
108109
func WithTx(parentCtx context.Context, f func(ctx context.Context) error) error {
109110
if InTransaction(parentCtx) {
110111
return ErrAlreadyInTransaction

0 commit comments

Comments
 (0)