This commit is contained in:
jay brown
2025-03-12 17:12:48 -07:00
parent f7c41c4ef3
commit 989db0486a
37 changed files with 2927 additions and 5 deletions
+2 -2
View File
@@ -34,7 +34,7 @@ func getStartTime(startupTime *time.Time, readBuildInfo func() (info *debug.Buil
return func() {
info, ok := readBuildInfo()
if !ok {
*startupTime = time.Now()
*startupTime = time.Now().UTC()
return
}
@@ -52,7 +52,7 @@ func getStartTime(startupTime *time.Time, readBuildInfo func() (info *debug.Buil
}
// Return current time if no build time found
*startupTime = time.Now()
*startupTime = time.Now().UTC()
}
}
+3 -3
View File
@@ -45,7 +45,7 @@ func TestGetVersionTimestamp(t *testing.T) {
}
// Test 4: Returned time should not be in the future
if t1.After(time.Now()) {
if t1.After(time.Now().UTC()) {
t.Errorf("Timestamp is in the future: %v", t1)
}
}
@@ -53,7 +53,7 @@ func TestGetVersionTimestamp(t *testing.T) {
func TestGetStartTime(t *testing.T) {
t.Run("vcs time", func(t *testing.T) {
var tt time.Time
expectedTime := time.Now()
expectedTime := time.Now().UTC()
f := getStartTime(&tt, func() (info *debug.BuildInfo, ok bool) {
return &debug.BuildInfo{
Settings: []debug.BuildSetting{
@@ -70,7 +70,7 @@ func TestGetStartTime(t *testing.T) {
})
t.Run("vcs time - invalid format", func(t *testing.T) {
var tt time.Time
expectedTime := time.Now()
expectedTime := time.Now().UTC()
f := getStartTime(&tt, func() (info *debug.BuildInfo, ok bool) {
return &debug.BuildInfo{
Settings: []debug.BuildSetting{