-
-
Notifications
You must be signed in to change notification settings - Fork 232
feat: Go 1.23 minimum, modernize codebase #820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR upgrades the minimum Go version to 1.23 and modernizes portions of the codebase to support the new tooling and linter checks. Key changes include updating the Go module and toolchain versions, refactoring configuration fields to use a unified Components structure, and modernizing idioms in tests and output formatting.
- Upgrade minimum Go version in go.mod, README.md, and CI configurations.
- Refactor configuration usage from OpenAPI.Components to Components.
- Update various tests and code segments for more idiomatic assertions and efficient formatting.
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| validate.go | Adjusts hostname validation condition for clarity. |
| sse/sse.go | Replaces fmt.Sprintf with fmt.Appendf for performance improvements. |
| queryparam/queryparam_test.go | Uses assert.Empty for more idiomatic test assertions. |
| negotiation/negotiation_test.go | Updates assertions to use assert.Empty for unmatched cases. |
| humatest/humatest_test.go | Migrates some assertions to assert.JSONEq and adds nolint comments for static checks. |
| humacli/humacli.go | Simplifies options variable declaration. |
| defaults.go | Refactors config initialization to use the new Components field. |
| casing/casing.go | Adds nolint comments with unchanged functionality. |
| api.go | Switches from OpenAPI.Components to Components and updates schema marshaling accordingly. |
| adapters/humago/humago.go | Removes legacy runtime version check in favor of enforcing Go 1.23+ via build constraints. |
| go.mod, .golangci.yml, ci.yaml | Updates module, dependency, tooling, and CI settings to align with new Go versions. |
| docs/tutorial/installation.md | Updates documentation to require Go 1.23 or newer. |
| docs/features/bring-your-own-router.md | Clarifies Go version requirement for the humago adapter. |
Comments suppressed due to low confidence (3)
defaults.go:84
- Ensure that downstream code consuming the operations is updated to reflect the new placement of OnAddOperation in config; update related documentation if necessary.
c.OnAddOperation = append(c.OnAddOperation, linkTransformer.OnAddOperation)
api.go:388
- Make sure the change from config.OpenAPI.Components.Schemas to config.Components.Schemas is fully adopted in internal usage and documentation.
if config.Components.Schemas == nil {
adapters/humago/humago.go:69
- Ensure that this adapter is only used with Go 1.22+ (or newer) now that the runtime version check has been removed; verify that all environments comply with the new minimum version.
return c.r.PathValue(name)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #820 +/- ##
=======================================
Coverage 93.08% 93.08%
=======================================
Files 23 23
Lines 5307 5307
=======================================
Hits 4940 4940
Misses 314 314
Partials 53 53 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This upgrades the minimum Go version to 1.23 (the last officially supported version at the time of this writing as Go officially supports the latest two major versions: 1.23 and 1.24).
It also upgrades the linter check and modernizes the codebase somewhat to pass checks.
FYI, this is needed to support some dependabot updates for security issues, as the updated libraries require newer Go versions.