79634514

Date: 2025-05-22 20:51:01
Score: 1
Natty:
Report link

If an error is encountered before you are able to commit, you may want to still rollback. You can defer the Rollback for this case and ignore the ErrTxDone error if Commit is successfully invoked.

tx, err := appState.PgConn.Beginx()
if err != nil {
  return err
}
defer tx.Rollback()
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: stuft2