aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--backend/admin/handler.go4
-rw-r--r--backend/admin/handler_test.go2
-rw-r--r--backend/api/handler.go4
-rw-r--r--backend/api/handler_test.go2
4 files changed, 6 insertions, 6 deletions
diff --git a/backend/admin/handler.go b/backend/admin/handler.go
index 9bdeb69..8eac425 100644
--- a/backend/admin/handler.go
+++ b/backend/admin/handler.go
@@ -1145,9 +1145,9 @@ func (h *Handler) postTournamentNew(c echo.Context) error {
return err
}
// Create match slots for all rounds
- for round := 0; round < numRounds; round++ {
+ for round := range numRounds {
numPositions := bracketSize / (1 << (round + 1))
- for pos := 0; pos < numPositions; pos++ {
+ for pos := range numPositions {
if err := qtx.CreateTournamentMatch(ctx, db.CreateTournamentMatchParams{
TournamentID: tournamentID,
Round: int32(round),
diff --git a/backend/admin/handler_test.go b/backend/admin/handler_test.go
index 7249c2b..9de9a0b 100644
--- a/backend/admin/handler_test.go
+++ b/backend/admin/handler_test.go
@@ -338,7 +338,7 @@ type mockRenderer struct {
lastData any
}
-func (r *mockRenderer) Render(_ io.Writer, name string, data interface{}, _ echo.Context) error {
+func (r *mockRenderer) Render(_ io.Writer, name string, data any, _ echo.Context) error {
r.lastTemplateName = name
r.lastData = data
return nil
diff --git a/backend/api/handler.go b/backend/api/handler.go
index 4105efc..8d0d9be 100644
--- a/backend/api/handler.go
+++ b/backend/api/handler.go
@@ -554,9 +554,9 @@ func (h *Handler) GetTournament(ctx context.Context, request GetTournamentReques
}
resultByKey := make(map[matchKey]*matchResult)
- for round := 0; round < numRounds; round++ {
+ for round := range numRounds {
numPositions := bracketSize / (1 << (round + 1))
- for pos := 0; pos < numPositions; pos++ {
+ for pos := range numPositions {
m, exists := matchByKey[matchKey{round, pos}]
mr := &matchResult{}
diff --git a/backend/api/handler_test.go b/backend/api/handler_test.go
index a3ca3fb..2415710 100644
--- a/backend/api/handler_test.go
+++ b/backend/api/handler_test.go
@@ -729,7 +729,7 @@ func TestGetGameWatchLatestStates_Empty(t *testing.T) {
func TestToNullableWith(t *testing.T) {
t.Run("nil value", func(t *testing.T) {
- result := toNullableWith[int, string](nil, func(_ int) string { return "x" })
+ result := toNullableWith(nil, func(_ int) string { return "x" })
if !result.IsNull() {
t.Error("expected null for nil input")
}