Skip to content

Commit 67c1376

Browse files
authored
Merge pull request mattn#754 from codesoap/master
Improve readability of Backup()
2 parents c64f703 + 17bc447 commit 67c1376

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

backup.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@ type SQLiteBackup struct {
2525
}
2626

2727
// Backup make backup from src to dest.
28-
func (c *SQLiteConn) Backup(dest string, conn *SQLiteConn, src string) (*SQLiteBackup, error) {
28+
func (destConn *SQLiteConn) Backup(dest string, srcConn *SQLiteConn, src string) (*SQLiteBackup, error) {
2929
destptr := C.CString(dest)
3030
defer C.free(unsafe.Pointer(destptr))
3131
srcptr := C.CString(src)
3232
defer C.free(unsafe.Pointer(srcptr))
3333

34-
if b := C.sqlite3_backup_init(c.db, destptr, conn.db, srcptr); b != nil {
34+
if b := C.sqlite3_backup_init(destConn.db, destptr, srcConn.db, srcptr); b != nil {
3535
bb := &SQLiteBackup{b: b}
3636
runtime.SetFinalizer(bb, (*SQLiteBackup).Finish)
3737
return bb, nil
3838
}
39-
return nil, c.lastError()
39+
return nil, destConn.lastError()
4040
}
4141

4242
// Step to backs up for one step. Calls the underlying `sqlite3_backup_step`

0 commit comments

Comments
 (0)