From 64a8adf7039ea91d0674c80e05f4942116c5339f Mon Sep 17 00:00:00 2001 From: Eugene Triguba Date: Sat, 6 Jan 2024 11:53:18 -0500 Subject: Tweak model tests --- internal/models/migration.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'internal/models/migration.go') diff --git a/internal/models/migration.go b/internal/models/migration.go index c02f17a..a4b694c 100644 --- a/internal/models/migration.go +++ b/internal/models/migration.go @@ -3,8 +3,7 @@ package models import ( "fmt" "strings" - - "github.com/eugenetriguba/bolt/internal/util" + "time" ) type Migration struct { @@ -13,12 +12,10 @@ type Migration struct { Applied bool } -func NewMigration(clock util.Clock, message string) *Migration { - now := clock.Now() +func NewMigration(ts time.Time, message string) *Migration { version := fmt.Sprintf( - "%d%02d%02d%02d%02d%02d", - now.Year(), now.Month(), now.Day(), - now.Hour(), now.Minute(), now.Second(), + "%d%02d%02d%02d%02d%02d", ts.Year(), ts.Month(), ts.Day(), + ts.Hour(), ts.Minute(), ts.Second(), ) return &Migration{Version: version, Message: message, Applied: false} } -- cgit v1.2.3