(Feat): Initial Commit
Some checks failed
Build & Test / build-test (push) Has been cancelled
Build & Test / swagger-codegen-cli (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled

This commit is contained in:
2026-07-03 19:41:31 +05:30
commit 7e940c83a7
461 changed files with 45002 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
package test
import (
"testing"
"time"
"allaboutapps.dev/aw/go-starter/internal/api"
"github.com/dropbox/godropbox/time2"
)
func GetMockClock(t *testing.T, clock time2.Clock) *time2.MockClock {
t.Helper()
mc, ok := clock.(*time2.MockClock)
if !ok {
t.Fatalf("invalid clock type, got %T, want *time2.MockClock", clock)
}
return mc
}
func SetMockClock(t *testing.T, s *api.Server, time time.Time) {
t.Helper()
mockClock := GetMockClock(t, s.Clock)
mockClock.Set(time)
}