Skip to content

Commit

Permalink
lint happy.
Browse files Browse the repository at this point in the history
  • Loading branch information
PaienNate committed Oct 19, 2024
1 parent 9b9de61 commit d583728
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dice/model/sqlhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (z *zapHook) After(ctx context.Context, query string, args ...interface{})

var durationField string
if v, ok := ctx.Value((*sqlDurationKey)(nil)).(time.Time); ok {
durationField = fmt.Sprintf("%v", time.Now().Sub(v))
durationField = fmt.Sprintf("%v", time.Since(v))
}

z.Debugf("SQL 执行后: %v 耗时: %v 秒", buildQueryArgsFields(query, args...), durationField)
Expand Down
2 changes: 1 addition & 1 deletion dice/model/sqlhook_cgo.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (z *zapHook) After(ctx context.Context, query string, args ...interface{})

var durationField string
if v, ok := ctx.Value((*sqlDurationKey)(nil)).(time.Time); ok {
durationField = fmt.Sprintf("%v", time.Now().Sub(v))
durationField = fmt.Sprintf("%v", time.Since(v))
}

z.Debugf("SQL 执行后: %v 耗时: %v 秒", buildQueryArgsFields(query, args...), durationField)
Expand Down

0 comments on commit d583728

Please sign in to comment.