resty v3.0.0-rc.4 版本更新介绍
发布日期: 2026-09-06
版本号: v3.0.0-rc.4
go-resty/resty 发布 v3.0.0-rc.4 候选版本。本次修复了多个问题:multipart 生产者在提前响应后未停止导致的竞态与卡死、按 RFC 7616 解析 digest 挑战、不再分配池化缓冲区和别名切片、SetBaseURL 保留末尾斜杠、SSE 因递归读锁导致的连接死锁及响应体泄漏。增强方面新增了对 HTTP QUERY 方法(RFC 10008)的支持,对冲请求不再取消获胜响应的响应体,修复了负载均衡器数据竞争、重复状态变更钩子和 ticker 协程泄漏,并保护了调试日志的类型断言、保留限速器的 context 原因。同时修复了测试中依赖环境的不稳定断言,替换了 SSE 文档中的失效域名,CI 侧将 GitHub Actions 固定到 commit SHA 并声明工作流权限、新增工作流安全检查,版本号升级至 v3.0.0-rc.4。本次共有 7 位新贡献者首次参与贡献。
更新内容 (中文)
v3 Release Candidate 4
v3 指南
- 升级指南:https://resty.dev/docs/upgrading-to-v3/
问题修复
- fix: 在提前响应后停止 multipart 生产者,避免竞态/挂起,由 @Solaris-star 提交,见 https://github.com/go-resty/resty/pull/1188
- fix: 按 RFC 7616 解析 digest 质询,由 @mrueg 提交,见 https://github.com/go-resty/resty/pull/1203
- fix: 停止分发池化缓冲区和别名切片,由 @mrueg 提交,见 https://github.com/go-resty/resty/pull/1202
- fix: 在 SetBaseURL 中保留末尾斜杠(修复 #1061),由 @ObeeJ 提交,见 https://github.com/go-resty/resty/pull/1191
- fix: 修复由递归读锁导致的 SSE 连接死锁,以及泄漏的响应体,由 @mrueg 提交,见 https://github.com/go-resty/resty/pull/1199
增强
- feat: 新增对 HTTP QUERY 方法(RFC 10008)的支持,由 @thatwasyahya 提交,见 https://github.com/go-resty/resty/pull/1187
- fix(enhancement): 对冲请求不再取消获胜响应的响应体,由 @mrueg 提交,见 https://github.com/go-resty/resty/pull/1197
- fix(enhancement): 修复负载均衡器数据竞态、重复的状态变更钩子、ticker goroutine 泄漏,由 @mrueg 提交,见 https://github.com/go-resty/resty/pull/1198
- fix(enhancement): 保护调试日志的类型断言并保留限流器的 context cause,由 @mrueg 提交,见 https://github.com/go-resty/resty/pull/1204
测试
- test: 修复 TestTraceInfoOnTimeoutWithSetTimeout 中依赖环境的不稳定断言,由 @Yashh56 提交,见 https://github.com/go-resty/resty/pull/1184
文档
- docs(sse): 将失效的 sse.dev 域名替换为 example.com,由 @donbagger 提交,见 https://github.com/go-resty/resty/pull/1205
CI 与发布
- chore: 将版本号提升至 3.0.0-rc.3+devrc4 用于下一次开发迭代,由 @jeevatkm 提交,见 https://github.com/go-resty/resty/pull/1183
- ci: 将 github actions 固定到 commit sha 并声明 workflow 权限,由 @Totara-thib 提交,见 https://github.com/go-resty/resty/pull/1193
- ci: 新增 plumber workflow 安全检查,由 @Totara-thib 提交,见 https://github.com/go-resty/resty/pull/1194
- release: 版本号提升至 v3.0.0-rc.4,由 @jeevatkm 提交,见 https://github.com/go-resty/resty/pull/1206
新贡献者
- @Yashh56 在 https://github.com/go-resty/resty/pull/1184 完成首次贡献
- @thatwasyahya 在 https://github.com/go-resty/resty/pull/1187 完成首次贡献
- @Solaris-star 在 https://github.com/go-resty/resty/pull/1188 完成首次贡献
- @donbagger 在 https://github.com/go-resty/resty/pull/1205 完成首次贡献
- @mrueg 在 https://github.com/go-resty/resty/pull/1203 完成首次贡献
- @Totara-thib 在 https://github.com/go-resty/resty/pull/1193 完成首次贡献
- @ObeeJ 在 https://github.com/go-resty/resty/pull/1191 完成首次贡献
完整变更日志:https://github.com/go-resty/resty/compare/v3.0.0-rc.3…v3.0.0-rc.4
更新内容 (原始)
v3 Release Candidate 4
v3 Guide
- Upgrade Guide: https://resty.dev/docs/upgrading-to-v3/
Bug Fixes
- fix: stop multipart producer after early response without race/hang by @Solaris-star in https://github.com/go-resty/resty/pull/1188
- fix: digest challenge parsing per RFC 7616 by @mrueg in https://github.com/go-resty/resty/pull/1203
- fix: stop handing out pooled buffers and aliased slices by @mrueg in https://github.com/go-resty/resty/pull/1202
- fix: preserve trailing slash in SetBaseURL (fixes #1061) by @ObeeJ in https://github.com/go-resty/resty/pull/1191
- fix: SSE connect deadlock from a recursive read lock, plus a leaked response body by @mrueg in https://github.com/go-resty/resty/pull/1199
Enhancements
- feat: add support for the HTTP QUERY method (RFC 10008) by @thatwasyahya in https://github.com/go-resty/resty/pull/1187
- fix(enhancement): hedging no longer cancels the winning response body by @mrueg in https://github.com/go-resty/resty/pull/1197
- fix(enhancement): load balancer data race, duplicate state-change hooks, ticker goroutine leak by @mrueg in https://github.com/go-resty/resty/pull/1198
- fix(enhancement): guard the debug-log type assertion and keep the rate limiter’s context cause by @mrueg in https://github.com/go-resty/resty/pull/1204
Tests
- test: Fix environment-dependent flaky assertion in TestTraceInfoOnTimeoutWithSetTimeout by @Yashh56 in https://github.com/go-resty/resty/pull/1184
Documentation
- docs(sse): replace the dead sse.dev host with example.com by @donbagger in https://github.com/go-resty/resty/pull/1205
CI & Release
- chore: bump version to 3.0.0-rc.3+devrc4 for next dev iteration by @jeevatkm in https://github.com/go-resty/resty/pull/1183
- ci: pin github actions to commit shas and declare workflow permissions by @Totara-thib in https://github.com/go-resty/resty/pull/1193
- ci: add plumber workflow security check by @Totara-thib in https://github.com/go-resty/resty/pull/1194
- release: version bump to v3.0.0-rc.4 by @jeevatkm in https://github.com/go-resty/resty/pull/1206
New Contributors
- @Yashh56 made their first contribution in https://github.com/go-resty/resty/pull/1184
- @thatwasyahya made their first contribution in https://github.com/go-resty/resty/pull/1187
- @Solaris-star made their first contribution in https://github.com/go-resty/resty/pull/1188
- @donbagger made their first contribution in https://github.com/go-resty/resty/pull/1205
- @mrueg made their first contribution in https://github.com/go-resty/resty/pull/1203
- @Totara-thib made their first contribution in https://github.com/go-resty/resty/pull/1193
- @ObeeJ made their first contribution in https://github.com/go-resty/resty/pull/1191
Full Changelog: https://github.com/go-resty/resty/compare/v3.0.0-rc.3...v3.0.0-rc.4