Skip to content

Modernize codebase: replace interface{} with any#2419

Merged
paganotoni merged 1 commit intomainfrom
modernize-interface-to-any
Mar 20, 2026
Merged

Modernize codebase: replace interface{} with any#2419
paganotoni merged 1 commit intomainfrom
modernize-interface-to-any

Conversation

@paganotoni
Copy link
Member

This PR modernizes the codebase by replacing deprecated patterns with modern Go idioms:

Changes

1. Replace interface{} with any (Go 1.18+)

  • Replaced 104 occurrences of interface{} with any across 41 files
  • Updated error message strings to reference map[string]any instead of map[string]interface{}
  • This change leverages the type alias added in Go 1.18 for cleaner, more readable code

2. Update error handling (Go 1.13+ best practice)

  • Replaced os.IsNotExist(err) with errors.Is(err, os.ErrNotExist) in route_mappings.go
  • This is the recommended approach for error handling since Go 1.13

Testing

All tests pass successfully:

  • go test -shuffle on ./... passes for all packages
  • No functional changes, purely syntactic modernization

- Replace all interface{} type declarations with any (Go 1.18+)

- Update os.IsNotExist to errors.Is with os.ErrNotExist (Go 1.13+)

- Update error messages to reference map[string]any
@paganotoni paganotoni requested a review from a team as a code owner March 20, 2026 14:12
@paganotoni paganotoni enabled auto-merge March 20, 2026 14:14
@paganotoni paganotoni disabled auto-merge March 20, 2026 14:15
@paganotoni paganotoni merged commit 50b12d7 into main Mar 20, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant