database/sql: Tx.Prepare documentation should match Tx.PrepareContext #45978
Labels
Documentation
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
What version of Go are you using (
go version
)?What did you do?
Tx.PrepareContext explicitly says that the returned statement "will be closed when the transaction has been committed or rolled back.". But The Tx.Prepare description just says the returned statement "can no longer be used once the transaction has been committed or rolled back."
It gave me the impression that Tx.Prepare caller needs to take care of closing the returned statement, so does the example as well.
What did you expect to see?
Since Tx.Prepare is just a call to Tx.PrepareContext with background context, I expected the document to state that returned statement "will be closed when the transaction has been committed or rolled back.", i.e. the same way as the Tx.PrepareContext description.
The text was updated successfully, but these errors were encountered: