From 5789af0b645ddc5f9140474907a7ea763f4922aa Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Mon, 25 Sep 2017 11:01:23 -0500 Subject: [PATCH] Add doc for (*Tx) BeginBatch() --- batch.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/batch.go b/batch.go index 02f93daa..e385f078 100644 --- a/batch.go +++ b/batch.go @@ -24,7 +24,7 @@ type Batch struct { pendingCommandComplete bool ctx context.Context err error - inTx bool + inTx bool } // BeginBatch returns a *Batch query for c. @@ -32,6 +32,8 @@ func (c *Conn) BeginBatch() *Batch { return &Batch{conn: c} } +// BeginBatch returns a *Batch query for tx. Since this *Batch is already part +// of a transaction it will not automatically be wrapped in a transaction. func (tx *Tx) BeginBatch() *Batch { return &Batch{conn: tx.conn, inTx: true} }