use NowFunc replace time.Now

This commit is contained in:
0x2d3c 2021-01-10 17:12:33 +08:00
parent fe553a7c1a
commit 0208f532e0

View File

@ -6,7 +6,6 @@ import (
"fmt" "fmt"
"reflect" "reflect"
"sort" "sort"
"time"
"gorm.io/gorm/schema" "gorm.io/gorm/schema"
"gorm.io/gorm/utils" "gorm.io/gorm/utils"
@ -72,8 +71,8 @@ func (cs *callbacks) Raw() *processor {
} }
func (p *processor) Execute(db *DB) { func (p *processor) Execute(db *DB) {
curTime := time.Now()
stmt := db.Statement stmt := db.Statement
curTime := db.NowFunc()
if stmt.Model == nil { if stmt.Model == nil {
stmt.Model = stmt.Dest stmt.Model = stmt.Dest