Go version: 1.26.0
Date: 2026-02-18
Command: go fix -diff ./...
7 fixes across 7 files. The codebase is fairly modern — no deprecated patterns, no strings.Index → strings.Cut candidates, and min()/max() builtins are already in use.
| File | Line | Before | After |
|---|---|---|---|
pkg/db/announcement.go |
144 | []interface{}{} |
[]any{} |
pkg/web/handler_kagami.go |
145 | func() (interface{}, error) |
func() (any, error) |
Risk: None. any is a built-in alias for interface{} since Go 1.18. Pure readability improvement.
| File | Line | Before | After |
|---|---|---|---|
pkg/db/crafting_recipe.go |
48 | for j := 0; j < len(inputs); j++ |
for j := range len(inputs) |
pkg/mongodb/user_achievement.go |
69 | for i := 0; i < minLen; i++ |
for i := range minLen |
pkg/property/syncer_test.go |
32, 68 | for n := 0; n < 4; n++ |
for n := range 4 (×2) |
Risk: None. Range-over-integer (Go 1.22) is semantically identical for simple counted loops.
| File | Line | Field | Change |
|---|---|---|---|
pkg/web/dto.go |
54 | Result db.CardSpec |
json:"result,omitempty" → json:"result" |
pkg/web/handler_crafting.go |
18 | UserState UserState |
json:"user,omitempty" → json:"user" |
Risk: Behavioral change. omitempty on struct types omits the field only when the struct is its zero value. Removing it means the field is always serialized (even when zero). If API clients depend on these fields being absent in certain responses, this changes the JSON contract.
The tool also noted it ignored an alternative omitzero fix (new in Go 1.26) since that would also be a behavior change.
Recommendation: Review these two fields against actual API usage before applying.
- No
strings.Index→strings.Cutcandidates - No
if/else→min()/max()candidates (already using builtins) - No deprecated stdlib usage
- No
sort.Slice→slices.SortFunccandidates
Safe mechanical upgrades (categories 1 & 2):
go fix -any -rangeint ./...All fixes including omitempty removal:
go fix ./...