Skip to content

Commit

Permalink
Fixed bad reference to db in builder
Browse files Browse the repository at this point in the history
  • Loading branch information
qiangxue authored Feb 2, 2018
1 parent ea984d8 commit 244ab54
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions db.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,15 @@ func MustOpen(driverName, dsn string) (*DB, error) {

// Clone makes a shallow copy of DB.
func (db *DB) Clone() *DB {
return &DB{
db2 := &DB{
driverName: db.driverName,
sqlDB: db.sqlDB,
Builder: db.Builder,
FieldMapper: db.FieldMapper,
PerfFunc: db.PerfFunc,
LogFunc: db.LogFunc,
}
db2.Builder = db2.newBuilder(db.sqlDB)
return db2
}

// DB returns the sql.DB instance encapsulated by dbx.DB.
Expand Down

0 comments on commit 244ab54

Please sign in to comment.