Skip to content

docs(recovery): clarify RecoveryWithWriter only uses the first RecoveryFunc#4610

Open
Gav1nnn wants to merge 1 commit intogin-gonic:masterfrom
Gav1nnn:fix-4044-recoverywithwriter-docs-and-test
Open

docs(recovery): clarify RecoveryWithWriter only uses the first RecoveryFunc#4610
Gav1nnn wants to merge 1 commit intogin-gonic:masterfrom
Gav1nnn:fix-4044-recoverywithwriter-docs-and-test

Conversation

@Gav1nnn
Copy link
Copy Markdown

@Gav1nnn Gav1nnn commented Mar 31, 2026

Summary

Clarify the RecoveryWithWriter behavior when multiple RecoveryFunc values
are passed.

Gin currently only uses the first recovery handler from the variadic argument
list. This change documents that behavior and adds a test to prevent future
confusion.

Changes

  • update the exported comment on RecoveryWithWriter
  • add a test verifying only the first recovery handler is used

Fixes #4044

  • gin/recovery.go:44
  • gin/recovery_test.go:259

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.43%. Comparing base (3dc1cd6) to head (a6d98e9).
⚠️ Report is 275 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4610      +/-   ##
==========================================
- Coverage   99.21%   98.43%   -0.78%     
==========================================
  Files          42       48       +6     
  Lines        3182     3138      -44     
==========================================
- Hits         3157     3089      -68     
- Misses         17       40      +23     
- Partials        8        9       +1     
Flag Coverage Δ
?
--ldflags="-checklinkname=0" -tags sonic 98.42% <ø> (?)
-tags go_json 98.29% <ø> (?)
-tags nomsgpack 98.35% <ø> (?)
go-1.18 ?
go-1.19 ?
go-1.20 ?
go-1.21 ?
go-1.25 98.37% <ø> (?)
go-1.26 98.43% <ø> (?)
macos-latest 98.37% <ø> (-0.84%) ⬇️
ubuntu-latest 98.43% <ø> (-0.78%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

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.

RecoveryWithWriter takes mulitple RecoveryFuncs but only applies the first

1 participant