The Enhancement
At first, it was thought that Commit-on-Close convention would be more preferable, than others, but after some time, it is clear that this introduces more problems than convenience, for example, it is hard to make a normal error catching + defer for Close, because the Commit is made during Close.
The Proposal
Split logic into two methods -- Commit and Close, make Close do not return any errors (but still return nil to conform to default APIs)
The Enhancement
At first, it was thought that
Commit-on-Closeconvention would be more preferable, than others, but after some time, it is clear that this introduces more problems than convenience, for example, it is hard to make a normal error catching +deferforClose, because theCommitis made duringClose.The Proposal
Split logic into two methods --
CommitandClose, makeClosedo not return any errors (but still returnnilto conform to default APIs)