mirror of https://github.com/mattn/go-sqlite3.git
Add error checking in simple example for tx.Commit
Based on https://golang.org/pkg/database/sql/#Tx.Commit this function returns an error type. So why not check it.
This commit is contained in:
parent
43dcd3131f
commit
b819467576
|
@ -42,7 +42,10 @@ func main() {
|
|||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
tx.Commit()
|
||||
err = tx.Commit()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
rows, err := db.Query("select id, name from foo")
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue