mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore: update golang to 1.24.1 (#17035)
- Update go.mod to use Go 1.24.1 - Update GitHub Actions setup-go action to use Go 1.24.1 - Fix linting issues with golangci-lint by: - Updating to golangci-lint v1.57.1 (more compatible with Go 1.24.1) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Claude <claude@anthropic.com>
This commit is contained in:
@@ -2119,10 +2119,11 @@ func createTemplateVersion(t testing.TB, db database.Store, tpl database.Templat
|
||||
dbgen.WorkspaceBuild(t, db, database.WorkspaceBuild{
|
||||
WorkspaceID: wrk.ID,
|
||||
TemplateVersionID: version.ID,
|
||||
BuildNumber: int32(i) + 2,
|
||||
Transition: trans,
|
||||
InitiatorID: tpl.CreatedBy,
|
||||
JobID: latestJob.ID,
|
||||
// #nosec G115 - Safe conversion as build number is expected to be within int32 range
|
||||
BuildNumber: int32(i) + 2,
|
||||
Transition: trans,
|
||||
InitiatorID: tpl.CreatedBy,
|
||||
JobID: latestJob.ID,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -3182,21 +3183,22 @@ func TestGetUserStatusCounts(t *testing.T) {
|
||||
row.Date.In(location).String(),
|
||||
i,
|
||||
)
|
||||
if row.Date.Before(createdAt) {
|
||||
switch {
|
||||
case row.Date.Before(createdAt):
|
||||
require.Equal(t, int64(0), row.Count)
|
||||
} else if row.Date.Before(firstTransitionTime) {
|
||||
case row.Date.Before(firstTransitionTime):
|
||||
if row.Status == tc.initialStatus {
|
||||
require.Equal(t, int64(1), row.Count)
|
||||
} else if row.Status == tc.targetStatus {
|
||||
require.Equal(t, int64(0), row.Count)
|
||||
}
|
||||
} else if !row.Date.After(today) {
|
||||
case !row.Date.After(today):
|
||||
if row.Status == tc.initialStatus {
|
||||
require.Equal(t, int64(0), row.Count)
|
||||
} else if row.Status == tc.targetStatus {
|
||||
require.Equal(t, int64(1), row.Count)
|
||||
}
|
||||
} else {
|
||||
default:
|
||||
t.Errorf("date %q beyond expected range end %q", row.Date, today)
|
||||
}
|
||||
}
|
||||
@@ -3337,18 +3339,19 @@ func TestGetUserStatusCounts(t *testing.T) {
|
||||
expectedCounts[d][tc.user2Transition.to] = 0
|
||||
|
||||
// Counted Values
|
||||
if d.Before(createdAt) {
|
||||
switch {
|
||||
case d.Before(createdAt):
|
||||
continue
|
||||
} else if d.Before(firstTransitionTime) {
|
||||
case d.Before(firstTransitionTime):
|
||||
expectedCounts[d][tc.user1Transition.from]++
|
||||
expectedCounts[d][tc.user2Transition.from]++
|
||||
} else if d.Before(secondTransitionTime) {
|
||||
case d.Before(secondTransitionTime):
|
||||
expectedCounts[d][tc.user1Transition.to]++
|
||||
expectedCounts[d][tc.user2Transition.from]++
|
||||
} else if d.Before(today) {
|
||||
case d.Before(today):
|
||||
expectedCounts[d][tc.user1Transition.to]++
|
||||
expectedCounts[d][tc.user2Transition.to]++
|
||||
} else {
|
||||
default:
|
||||
t.Fatalf("date %q beyond expected range end %q", d, today)
|
||||
}
|
||||
}
|
||||
@@ -3441,11 +3444,12 @@ func TestGetUserStatusCounts(t *testing.T) {
|
||||
i,
|
||||
)
|
||||
require.Equal(t, database.UserStatusActive, row.Status)
|
||||
if row.Date.Before(createdAt) {
|
||||
switch {
|
||||
case row.Date.Before(createdAt):
|
||||
require.Equal(t, int64(0), row.Count)
|
||||
} else if i == len(userStatusChanges)-1 {
|
||||
case i == len(userStatusChanges)-1:
|
||||
require.Equal(t, int64(0), row.Count)
|
||||
} else {
|
||||
default:
|
||||
require.Equal(t, int64(1), row.Count)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user