Skip to content

Commit

Permalink
Merge pull request #41 from lorneli/bbolt_db
Browse files Browse the repository at this point in the history
db: return t.Rollback directly in the end of View function
  • Loading branch information
xiang90 committed Sep 12, 2017
2 parents 63f0e07 + ea18f34 commit a4199f8
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions db.go
Original file line number Diff line number Diff line change
Expand Up @@ -687,11 +687,7 @@ func (db *DB) View(fn func(*Tx) error) error {
return err
}

if err := t.Rollback(); err != nil {
return err
}

return nil
return t.Rollback()
}

// Batch calls fn as part of a batch. It behaves similar to Update,
Expand Down

0 comments on commit a4199f8

Please sign in to comment.