Skip to content

Commit 997cab8

Browse files
committed
fix build
1 parent cf4bd56 commit 997cab8

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

backup.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func (b *SQLiteBackup) Step(p int) (bool, error) {
4848
if ret == C.SQLITE_DONE {
4949
return true, nil
5050
} else if ret != 0 && ret != C.SQLITE_LOCKED && ret != C.SQLITE_BUSY {
51-
return false, Error{Code: ErrNo(ret)}
51+
return false, &Error{Code: ErrNo(ret)}
5252
}
5353
return false, nil
5454
}
@@ -79,7 +79,7 @@ func (b *SQLiteBackup) Close() error {
7979
runtime.SetFinalizer(b, nil)
8080

8181
if ret != 0 {
82-
return Error{Code: ErrNo(ret)}
82+
return &Error{Code: ErrNo(ret)}
8383
}
8484
return nil
8585
}

error.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ var (
5858

5959
// Error return error message from errno.
6060
func (err ErrNo) Error() string {
61-
return Error{Code: err}.Error()
61+
return (&Error{Code: err}).Error()
6262
}
6363

6464
// Extend return extended errno.
@@ -68,7 +68,7 @@ func (err ErrNo) Extend(by int) ErrNoExtended {
6868

6969
// Error return error message that is extended code.
7070
func (err ErrNoExtended) Error() string {
71-
return Error{Code: ErrNo(C.int(err) & ErrNoMask), ExtendedCode: err}.Error()
71+
return (&Error{Code: ErrNo(C.int(err) & ErrNoMask), ExtendedCode: err}).Error()
7272
}
7373

7474
// Error return error message.

sqlite3.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ func (c *SQLiteConn) lastError() *Error {
404404
if rv == C.SQLITE_OK {
405405
return nil
406406
}
407-
return Error{
407+
return &Error{
408408
Code: ErrNo(rv),
409409
ExtendedCode: ErrNoExtended(C.sqlite3_extended_errcode(c.db)),
410410
err: C.GoString(C.sqlite3_errmsg(c.db)),
@@ -601,15 +601,15 @@ func (d *SQLiteDriver) Open(dsn string) (driver.Conn, error) {
601601
C.SQLITE_OPEN_CREATE,
602602
nil)
603603
if rv != 0 {
604-
return nil, Error{Code: ErrNo(rv)}
604+
return nil, &Error{Code: ErrNo(rv)}
605605
}
606606
if db == nil {
607607
return nil, errors.New("sqlite succeeded without returning a database")
608608
}
609609

610610
rv = C.sqlite3_busy_timeout(db, C.int(busyTimeout))
611611
if rv != C.SQLITE_OK {
612-
return nil, Error{Code: ErrNo(rv)}
612+
return nil, &Error{Code: ErrNo(rv)}
613613
}
614614

615615
conn := &SQLiteConn{db: db, loc: loc, txlock: txlock}

0 commit comments

Comments
 (0)