aboutsummaryrefslogtreecommitdiff
path: root/refstore/files/transaction_abort.go
blob: 7b92472c2e3c51d4b09b81674bfb76c8e015b8ca (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package files

import "fmt"

func (tx *Transaction) Abort() error {
	err := tx.ensureOpen()
	if err != nil {
		return err
	}

	tx.closed = true

	return nil
}

func (tx *Transaction) ensureOpen() error {
	if tx.closed {
		return fmt.Errorf("refstore/files: transaction already closed")
	}

	return nil
}