Skip to content

Commit

Permalink
db: return t.Rollback directly in the end of View function
Browse files Browse the repository at this point in the history
Make return line of db.View corresponding with db.Update.
  • Loading branch information
lorneli committed Sep 12, 2017
1 parent 4ff482b commit ea18f34
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 ea18f34

Please sign in to comment.