diff --git a/sqlite3.go b/sqlite3.go index 0ae415f..2d504d9 100644 --- a/sqlite3.go +++ b/sqlite3.go @@ -298,7 +298,7 @@ func (ai *aggInfo) Done(ctx *C.sqlite3_context) { // Commit transaction. func (tx *SQLiteTx) Commit() error { _, err := tx.c.exec(context.Background(), "COMMIT", nil) - if err != nil && err.(Error).Code == C.SQLITE_BUSY { + if err != nil && err.(*Error).Code == C.SQLITE_BUSY { // sqlite3 will leave the transaction open in this scenario. // However, database/sql considers the transaction complete once we // return from Commit() - we must clean up to honour its semantics. @@ -519,7 +519,7 @@ func (c *SQLiteConn) begin(ctx context.Context) (driver.Tx, error) { return &SQLiteTx{c}, nil } -func errorString(err Error) string { +func errorString(err *Error) string { return C.GoString(C.sqlite3_errstr(C.int(err.Code))) }