zeromicro/go-zero
 Watch   
 Star   
 Fork   
21 days ago
go-zero

goctl/v1.9.2

What's Changed

  • Swagger Improvements:

    • Fix swagger path generation: remove trailing slash for root routes with prefix #5212 (@Copilot)
    • Fix swagger generation: info block and server tags not included #5215 (@Copilot)
    • Restore API summaries in swagger generation #5237 (@kevwan)
  • Other Fixes:

    • Fix: issue #5154, not using SSE template files #5220 (@kevwan)

New Contributors

  • @rizkyikiw42 made their first contribution in #5210
  • @ZH1995 made their first contribution in #5233

Full Changelog: tools/goctl/v1.9.1...tools/goctl/v1.9.2

22 days ago
go-zero

v1.9.2

Overview

This release is solely focused on addressing a critical problem related to the go-redis dependency. Previous versions of go-redis were retracted, which could cause build failures, dependency resolution issues, or unexpected behavior for downstream projects relying on stable releases.

What's Fixed

  • go-redis Version Issue: The only change in this release is updating go-redis to circumvent the retracted versions. This ensures that consumers of this library can continue to build and use it reliably without encountering problems from retracted dependencies.
    • Chore: update go-redis for the retracted versions (#5235) by @kevwan

Impact

  • No Functional Changes: There are no new features, bug fixes, or breaking changes in this release. Functionality remains the same as the previous version.
  • Dependency Stability: Users should upgrade to this release if they are experiencing issues related to go-redis retractions or want to ensure their dependency tree remains stable.

New Contributors

While this release only addresses the go-redis issue, we'd like to acknowledge recent first-time contributors to the project:

Changelog

For a full list of changes between v1.9.1 and v1.9.2, see the changelog.


Upgrade Recommendation:
If you depend on redis, it is strongly recommended to upgrade to this release to avoid issues caused by the retracted versions.

2025-10-02 22:48:57
go-zero

goctl/v1.9.1

Highlights

  • Code generation ergonomics:
    • Add code generation headers to safe-to-edit files for clearer ownership and customization boundaries.
    • Fix array type generation issues to ensure accurate code output.
  • API developer experience:
    • Add complete test scaffolding for API projects via the --test flag.
  • Swagger/OpenAPI correctness:
    • Correct $ref placement in array definitions when useDefinitions is enabled.
  • Stability and optimizations:
    • Fix SSE handler blocking.
    • Optimize slice lookups and Unquote utility function performance.

Detailed Changes

Code Generation

  • Add code generation headers in safe-to-edit files to clarify which files are intended for user modifications while keeping generated segments intact.
    PR: feat: add code generation headers in safe to edit files by @kevwan (@5136)
  • Fix array type generation error to produce correct types in generated code.
    PR: fix array type generation error by @kesonan (@5142)

API/CLI

  • Add complete test scaffolding support for API projects using the --test flag, enabling quicker setup of testable services.
    PR: Add complete test scaffolding support with --test flag for API projects by @Copilot (@5176)

Swagger/OpenAPI

  • Fix $ref placement in array definitions when useDefinitions is enabled to align with the OpenAPI/Swagger schema expectations.
    PR: fix(goctl/swagger): correct $ref placement in array definitions when useDefinitions is enabled by @Copilot (@5199)

Stability

  • Fix SSE handler blocking behavior that could stall event delivery under certain conditions.
    PR: fix: SSE handler blocking by @wuqinqiang (@5181)

Performance and Utilities

  • Optimize slice find routines and the Unquote function for better runtime efficiency.
    PR: update: optimize slice find and Unquote func by @me-cs (@5108)

Upgrade Notes

  • Swagger regeneration: If you rely on useDefinitions, regenerate your Swagger/OpenAPI specs to pick up the corrected $ref placement.
  • Codegen headers: Newly generated safe-to-edit files will include headers clarifying edit expectations; no action required, but helpful for code review and maintenance.

Acknowledgements

  • Thanks to all contributors in this release: @kevwan, @kesonan, @me-cs, @wuqinqiang, and first-time contributor @Copilot. Your improvements enhance correctness, stability, and developer productivity for goctl users.

Full Changelog

2025-10-02 22:11:18
go-zero

v1.9.1

Highlights

  • Logging enhancements:
    • Customize log key names to fit your log schema and downstream tooling.
    • Prefer json.Marshaler over fmt.Stringer when emitting JSON logs, improving correctness and structure.
  • REST/SSE stability and operability:
    • Fix SSE handler blocking and reduce noisy logs by downgrading SetWriteDeadline errors to debug.
    • Add SetSSESlowThreshold to help detect slow clients and long writes.
  • Diagnostics and performance:
    • Improved mapreduce panic stacktraces for faster root-cause analysis.
    • Optimized machine performance data reading to reduce runtime overhead.

Detailed Changes

Logging

  • Support customizing log keys so you can align emitted fields (e.g., time, level, caller, message) to your organization’s conventions or ingestion pipeline requirements.
    PR: feat: support customize of log keys by @WqyJh (@5103)
  • Prefer json.Marshaler over fmt.Stringer when generating JSON logs, ensuring structured fields are serialized using their explicit JSON representations rather than ad-hoc strings.
    PR: feat: prefer json.Marshaler over fmt.Stringer for JSON log output by @WqyJh (@5117)

REST/SSE

  • Fix SSE handler blocking behavior that could stall responses under certain conditions.
    PR: fix: SSE handler blocking by @wuqinqiang (@5181)
  • Reduce log noise for transient I/O conditions by downgrading SetWriteDeadline errors to debug level in REST SSE.
    PR: fix(rest): change SSE SetWriteDeadline error log to debug level by @wuqinqiang (@5162)
  • Add sseSlowThreshold to surface slow SSE writes, enabling better observability about backpressure or slow clients.
    PR: feat(handler): add sseSlowThreshold by @wuqinqiang (@5196)

MapReduce

  • Improve panic stacktrace reporting in mapreduce, making error contexts clearer and debugging faster.
    PR: optimize: mapreduce panic stacktrace by @kevwan (@5168)

Performance and Runtime

  • Optimize machine performance data reading to lower collection overhead and reduce runtime impact.
    PR: opt: optimization of machine performance data reading by @wanwusangzhi (@5174)

Bug Fixes

  • Fix gRPC → HTTP mapping issue in gateway.
    PR: fix: issue-5110 by @guonaihong (@5113)

Migration and Usage Notes

  • Logging key customization:
    • If you rely on specific field names in log pipelines, consider setting the new custom key configuration to preserve schema consistency.
  • JSON log output:
    • If your types implement json.Marshaler, expect more accurate JSON in logs. If you previously depended on stringified representations, review downstream consumers to ensure compatibility.
  • SSE tuning:
    • Consider using SetSSESlowThreshold to flag slow clients or network conditions in environments sensitive to latency.
    • The SetWriteDeadline log level change reduces noise; adjust logger settings if you still want to surface these events.

Acknowledgements

  • Thanks to all contributors in this release: @WqyJh, @guonaihong, @wanwusangzhi, @kevwan, @wuqinqiang, and first-time contributor @Copilot. Your work improves performance, reliability, and developer ergonomics for everyone using go-zero.

Full Changelog

2025-08-31 23:37:00
go-zero

goctl/v1.9.0

What's Changed

New Contributors

Full Changelog: https://github.com/zeromicro/go-zero/compare/tools/goctl/v1.8.5...tools/goctl/v1.9.0

2025-08-17 17:50:38
go-zero

goctl/v1.9.0-alpha

What's Changed

New Contributors

Full Changelog: https://github.com/zeromicro/go-zero/compare/tools/goctl/v1.8.5...tools/goctl/v1.9.0-alpha

2025-08-15 20:08:02
go-zero

v1.9.0

What's Changed

  • feat: support masking sensitive data in logx by @kevwan in #5003
  • feat: add field tag (-) skip logic in unwrapFields in sqlx by @charmfocus in #5010
  • feat: upgrade to mongo-driver v2, and move v1 to zero-contrib by @me-cs in #4687
  • feat: add generic TypedSet with 2x performance boost and compile-time by @codeErrorSleep in #4888
  • feat: add custom middleware support with onion model in gateway by @DengY11 in #5035
  • feat: redis support consumer groups by @jk2K in #4912
  • feat: ignore unknown fields in gateway request parsing by @guonaihong in #5058
  • fix: issue with etcd key disappearing and unable to auto-re-register by @guonaihong in #4960
  • fix: SSE timeout will affected by http.Server's WriteTimeout by @csbzy in #5024
  • fix: unmarshal problem on env vars for type env string by @kevwan in #5037
  • fix: large memory usage on detail logging post requests by @kevwan in #5039
  • fix: Resolve HTML escaping issue during JSON serialization in httpx by @Disdjj in #5032
  • fix: resolve concurrent get may lead to empty result in ImmutableResource by @sunhao1296 in #5065
  • optimize: logging with fields by @kevwan in #5066

New Contributors

Detailed Release Notes: https://go-zero.dev/en/reference/releases/v1.9.0 Full Changelog: https://github.com/zeromicro/go-zero/compare/v1.8.5...v1.9.0

2025-07-13 11:18:51
go-zero

goctl/v1.8.5

What's Changed

  • Bug Fix: Fix for issue #4943 — fix goctl api swagger error (@kesonan)
  • Bug Fix: Fixed goctl api swagger panic with nil pointer when there is a wrong field tag in the API file (#4936)
  • Bug Fix: Resolved issue where timeout: 0s was not working in API files (#4932, @kevwan)
  • Bug Fix: Corrected PostgreSQL numeric type mapping in goctl model generation (#4992, @AnlynnLee)
  • Enhancement: Improved POST JSON parameter determination logic in goctl API Swagger and added unit tests (#4997, @Twilikiss)

New Contributors

  • @wanwusangzhi made their first contribution (#4944)
  • @geekeryy made their first contribution (#4979)
  • @Twilikiss made their first contribution (#4997)

Full Changelog: tools/goctl/v1.8.4...tools/goctl/v1.8.5

2025-07-13 00:00:52
go-zero

v1.8.5

Features

  • SQL Read/Write Splitting: Introduced SQL read/write splitting for improved database performance and scalability (#4976, #4990, #5000).
  • Serverless Support in REST: Added support for serverless use in REST services (#5001).

Bug Fixes & Improvements

  • Fixed HTTP SSE method timeout not working when timeout is set by server (#4932)
  • Fixed timeout 0s not working in API files (#4932)
  • Fixed panic caused by time.Duration type with numerical values (#4944)
  • Fixed duration type comparison in environment variable processing (#4979)

New Contributors

  • @wanwusangzhi made their first contribution (#4944)
  • @geekeryy made their first contribution (#4979)

Full Changelog: v1.8.4...v1.8.5

2025-06-09 18:08:20
go-zero

goctl/v1.8.4

Highlights

  • goctl 1.8.4 Features & Beta: New features and improvements in goctl, including mongo model generation with cache prefix and improved swagger consume types (#4849, #4869, #4903, #4907).
  • Bug Fixes & Compatibility: Multiple bug fixes for backward compatibility, timeout settings, spelling, type handling, and more (#4852, #4895, #4914, #4916, #4917, #4918, #4920, #4785, #4931).

What's Changed

New Contributors

  • @yguilai made their first contribution in #4874
  • @Caplost made their first contribution in #4917
  • @smiley-yoyo made their first contribution in #4907

Full Changelog: https://github.com/zeromicro/go-zero/compare/tools/goctl/v1.8.3...tools/goctl/v1.8.4