diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-02-20 22:24:47 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-02-20 22:24:47 +0900 |
| commit | aa07ba2e0a40b0097a4f9aee3c06dcbd9a749105 (patch) | |
| tree | 6b72119152e1dd17ef16703c5b2acb1dfe05c840 /backend/admin | |
| parent | 08ae228c45745372784017fe694d61d9ed0e2981 (diff) | |
| download | phperkaigi-2026-albatross-aa07ba2e0a40b0097a4f9aee3c06dcbd9a749105.tar.gz phperkaigi-2026-albatross-aa07ba2e0a40b0097a4f9aee3c06dcbd9a749105.tar.zst phperkaigi-2026-albatross-aa07ba2e0a40b0097a4f9aee3c06dcbd9a749105.zip | |
style(backend): modernize Go syntax with range-over-int and type inference
Use Go 1.22+ range-over-integer syntax, replace interface{} with any,
and remove redundant type parameters.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'backend/admin')
| -rw-r--r-- | backend/admin/handler.go | 4 | ||||
| -rw-r--r-- | backend/admin/handler_test.go | 2 |
2 files changed, 3 insertions, 3 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 |
