fix: new test and extract time.Now to mockable Clock #181
All checks were successful
Build Docker Image / Build-Docker-Image (push) Successful in 48s

This commit is contained in:
2024-10-05 23:40:37 +02:00
parent 6b033e2c2e
commit 3232632200
5 changed files with 73 additions and 12 deletions

17
service/clock.go Normal file
View File

@@ -0,0 +1,17 @@
package service
import "time"
type Clock interface {
Now() time.Time
}
type ClockImpl struct{}
func NewClockImpl() Clock {
return &ClockImpl{}
}
func (c *ClockImpl) Now() time.Time {
return time.Now()
}