mirror of https://github.com/golang/go.git
database/sql: add error check
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
This commit is contained in:
parent
7db8b9e518
commit
afbb86fde1
|
|
@ -140,6 +140,10 @@ where
|
|||
|
||||
var orderRef = "ABC123"
|
||||
tx, err := db.BeginTx(ctx, &sql.TxOptions{Isolation: sql.LevelSerializable})
|
||||
if err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
_, err = tx.ExecContext(ctx, "stored_proc_name", orderRef)
|
||||
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in New Issue