WithTransaction returns a new context holding the provided bolt transaction. Functions which require a bolt transaction will first check to see if a transaction is already created on the context before creating their own.
(ctx context.Context, tx *bolt.Tx)
| 29 | // first check to see if a transaction is already created on the |
| 30 | // context before creating their own. |
| 31 | func WithTransaction(ctx context.Context, tx *bolt.Tx) context.Context { |
| 32 | return context.WithValue(ctx, transactionKey{}, tx) |
| 33 | } |
| 34 | |
| 35 | // Transaction returns the transaction from the context |
| 36 | // if it has one. |
no outgoing calls
searching dependent graphs…