这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@danielgtaylor
Copy link
Owner

@danielgtaylor danielgtaylor commented May 9, 2025

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.

Copilot AI review requested due to automatic review settings May 9, 2025 23:32
Copy link
Contributor

Copilot AI left a 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
Copy link

codecov bot commented May 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.08%. Comparing base (eb497ee) to head (2b969cb).
Report is 3 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@danielgtaylor danielgtaylor merged commit 8012fc1 into main May 9, 2025
7 checks passed
@danielgtaylor danielgtaylor deleted the go-123 branch May 9, 2025 23:40
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.

2 participants