9.17.0
Added support for Redis 8.4, including new commands and features (#3572)
Introduced typed errors for better error handling using errors.As instead of string checks. Errors can now be wrapped and set to commands in hooks without breaking library functionality (#3602)
- CAS/CAD Commands: Added support for Compare-And-Set/Compare-And-Delete operations with conditional matching (
IFEQ,IFNE,IFDEQ,IFDNE) (#3583, #3595) - MSETEX: Atomically set multiple key-value pairs with expiration options and conditional modes (#3580)
- XReadGroup CLAIM: Consume both incoming and idle pending entries from streams in a single call (#3578)
- ACL Commands: Added
ACLGenPass,ACLUsers, andACLWhoAmI(#3576) - SLOWLOG Commands: Added
SLOWLOG LENandSLOWLOG RESET(#3585) - LATENCY Commands: Added
LATENCY LATESTandLATENCY RESET(#3584)
- Hybrid Search: Added EXPERIMENTAL support for the new
FT.HYBRIDcommand (#3573) - Vector Range: Added
VRANGEcommand for vector sets (#3543) - FT.INFO Enhancements: Added vector-specific attributes in FT.INFO response (#3596)
- Improved Connection Success Rate: Implemented FIFO queue-based fairness and context pattern for connection creation to prevent premature cancellation under high concurrency (#3518)
- Connection State Machine: Resolved race conditions and improved pool performance with proper state tracking (#3559)
- Pool Performance: Significant performance improvements with faster semaphores, lockless hook manager, and reduced allocations (47-67% faster Get/Put operations) (#3565)
- Canceled Metric Attribute: Added 'canceled' metrics attribute to distinguish context cancellation errors from other errors (#3566)
- Typed errors with wrapping support (#3602) by @ndyakov
- CAS/CAD commands (marked as experimental) (#3583, #3595) by @ndyakov, @htemelski-redis
- MSETEX command support (#3580) by @ofekshenawa
- XReadGroup CLAIM argument (#3578) by @ofekshenawa
- ACL commands: GenPass, Users, WhoAmI (#3576) by @destinyoooo
- SLOWLOG commands: LEN, RESET (#3585) by @destinyoooo
- LATENCY commands: LATEST, RESET (#3584) by @destinyoooo
- Hybrid search command (FT.HYBRID) (#3573) by @htemelski-redis
- Vector range command (VRANGE) (#3543) by @cxljs
- Vector-specific attributes in FT.INFO (#3596) by @ndyakov
- Improved connection pool success rate with FIFO queue (#3518) by @cyningsun
- Canceled metrics attribute for context errors (#3566) by @pvragov
- Fixed Failover Client MaintNotificationsConfig (#3600) by @ajax16384
- Fixed ACLGenPass function to use the bit parameter (#3597) by @destinyoooo
- Return error instead of panic from commands (#3568) by @dragneelfps
- Safety harness in
joinErrorsto prevent panic (#3577) by @manisharma
- Connection state machine with race condition fixes (#3559) by @ndyakov
- Pool performance improvements: 47-67% faster Get/Put, 33% less memory, 50% fewer allocations (#3565) by @ndyakov
- Updated to Redis 8.4.0 image (#3603) by @ndyakov
- Added Redis 8.4-RC1-pre to CI (#3572) by @ndyakov
- Refactored tests for idiomatic Go (#3561, #3562, #3563) by @12ya
We'd like to thank all the contributors who worked on this release!
@12ya, @ajax16384, @cxljs, @cyningsun, @destinyoooo, @dragneelfps, @htemelski-redis, @manisharma, @ndyakov, @ofekshenawa, @pvragov
Full Changelog: https://github.com/redis/go-redis/compare/v9.16.0...v9.17.0
9.17.0
Added support for Redis 8.4, including new commands and features (#3572)
Introduced typed errors for better error handling using errors.As instead of string checks. Errors can now be wrapped and set to commands in hooks without breaking library functionality (#3602)
- CAS/CAD Commands: Added support for Compare-And-Set/Compare-And-Delete operations with conditional matching (
IFEQ,IFNE,IFDEQ,IFDNE) (#3583, #3595) - MSETEX: Atomically set multiple key-value pairs with expiration options and conditional modes (#3580)
- XReadGroup CLAIM: Consume both incoming and idle pending entries from streams in a single call (#3578)
- ACL Commands: Added
ACLGenPass,ACLUsers, andACLWhoAmI(#3576) - SLOWLOG Commands: Added
SLOWLOG LENandSLOWLOG RESET(#3585) - LATENCY Commands: Added
LATENCY LATESTandLATENCY RESET(#3584)
- Hybrid Search: Added EXPERIMENTAL support for the new
FT.HYBRIDcommand (#3573) - Vector Range: Added
VRANGEcommand for vector sets (#3543) - FT.INFO Enhancements: Added vector-specific attributes in FT.INFO response (#3596)
- Improved Connection Success Rate: Implemented FIFO queue-based fairness and context pattern for connection creation to prevent premature cancellation under high concurrency (#3518)
- Connection State Machine: Resolved race conditions and improved pool performance with proper state tracking (#3559)
- Pool Performance: Significant performance improvements with faster semaphores, lockless hook manager, and reduced allocations (47-67% faster Get/Put operations) (#3565)
- Canceled Metric Attribute: Added 'canceled' metrics attribute to distinguish context cancellation errors from other errors (#3566)
- Typed errors with wrapping support (#3602) by @ndyakov
- CAS/CAD commands (marked as experimental) (#3583, #3595) by @ndyakov, @htemelski-redis
- MSETEX command support (#3580) by @ofekshenawa
- XReadGroup CLAIM argument (#3578) by @ofekshenawa
- ACL commands: GenPass, Users, WhoAmI (#3576) by @destinyoooo
- SLOWLOG commands: LEN, RESET (#3585) by @destinyoooo
- LATENCY commands: LATEST, RESET (#3584) by @destinyoooo
- Hybrid search command (FT.HYBRID) (#3573) by @htemelski-redis
- Vector range command (VRANGE) (#3543) by @cxljs
- Vector-specific attributes in FT.INFO (#3596) by @ndyakov
- Improved connection pool success rate with FIFO queue (#3518) by @cyningsun
- Canceled metrics attribute for context errors (#3566) by @pvragov
- Fixed Failover Client MaintNotificationsConfig (#3600) by @ajax16384
- Fixed ACLGenPass function to use the bit parameter (#3597) by @destinyoooo
- Return error instead of panic from commands (#3568) by @dragneelfps
- Safety harness in
joinErrorsto prevent panic (#3577) by @manisharma
- Connection state machine with race condition fixes (#3559) by @ndyakov
- Pool performance improvements: 47-67% faster Get/Put, 33% less memory, 50% fewer allocations (#3565) by @ndyakov
- Updated to Redis 8.4.0 image (#3603) by @ndyakov
- Added Redis 8.4-RC1-pre to CI (#3572) by @ndyakov
- Refactored tests for idiomatic Go (#3561, #3562, #3563) by @12ya
We'd like to thank all the contributors who worked on this release!
@12ya, @ajax16384, @cxljs, @cyningsun, @destinyoooo, @dragneelfps, @htemelski-redis, @manisharma, @ndyakov, @ofekshenawa, @pvragov
Full Changelog: https://github.com/redis/go-redis/compare/v9.16.0...v9.17.0
v3.0.0-rc.3
- Middleware/encryptCookie: Add cookie name authentication for EncryptCookie middleware by @gaby in https://github.com/gofiber/fiber/pull/3788
- Middleware/proxy: Add BodyStream() logic to
adaptor.FiberHandlermiddleware by @grivera64 in https://github.com/gofiber/fiber/pull/3799 - Client: Add support for HostClient and LBClient by @gaby in https://github.com/gofiber/fiber/pull/3774
- Native support for net/http and fasthttp handlers by @gaby in https://github.com/gofiber/fiber/pull/3769
- Add support for Express.js style req/res handlers by @gaby in https://github.com/gofiber/fiber/pull/3809
- Add support for DisableAutoRegister of HEAD routes by @ReneWerner87 in https://github.com/gofiber/fiber/pull/3817
- Add support for handling unsupported HTTP methods as HTTP 501 by @gaby in https://github.com/gofiber/fiber/pull/3854
- Add support for ReloadViews() by @gaby in https://github.com/gofiber/fiber/pull/3876
- Expose startup message customization hooks by @efectn in https://github.com/gofiber/fiber/pull/3824
- Middleware/adaptor: prevent CopyContextToFiberContext panic and add comprehensive test coverage by @sixcolors in https://github.com/gofiber/fiber/pull/3770
- Middleware/adaptor: Add flushing-related unit tests for net/http adaptor by @grivera64 in https://github.com/gofiber/fiber/pull/3807
- Middleware/encryptCookie: Return error during EncryptCookie failure by @gaby in https://github.com/gofiber/fiber/pull/3842
- Client: Preallocate slice size in Client::Param() by @arturmelanchyk in https://github.com/gofiber/fiber/pull/3782
- Reduce allocations in Request (saves ~16% B/op) by @arturmelanchyk in https://github.com/gofiber/fiber/pull/3768
- Make boundary a const by @arturmelanchyk in https://github.com/gofiber/fiber/pull/3783
- Skip locking garbage collector if nothing to delete by @arturmelanchyk in https://github.com/gofiber/fiber/pull/3787
- Reduce the memory usage of cacheableStatusCodes by @ZihxS in https://github.com/gofiber/fiber/pull/3789
- Merge duplicate constants by @jsoref in https://github.com/gofiber/fiber/pull/3812
- Improve propagation of context.Context by @gaby in https://github.com/gofiber/fiber/pull/3822
- Inline Request state wrappers by @arturmelanchyk in https://github.com/gofiber/fiber/pull/3827
- Remove unneeded "utils" alias by @arturmelanchyk in https://github.com/gofiber/fiber/pull/3834
- Benchmark for cache miss case by @arturmelanchyk in https://github.com/gofiber/fiber/pull/3836
- Add FullPath() helper to context by @gaby in https://github.com/gofiber/fiber/pull/3837
- Handle nil map targets in Binder by @gaby in https://github.com/gofiber/fiber/pull/3839
- Extracted generic releasePooledBinder function by @arturmelanchyk in https://github.com/gofiber/fiber/pull/3841
- Refactor internal errors to use sentinel values by @gaby in https://github.com/gofiber/fiber/pull/3864
- Test HEAD request compliance by @gaby in https://github.com/gofiber/fiber/pull/3868
- Improve OPTIONS wildcard regression test by @gaby in https://github.com/gofiber/fiber/pull/3869
- Improve byte-range handling for SendFile() by @gaby in https://github.com/gofiber/fiber/pull/3870
- Use int64 when dealing with HTTP Ranges by @gaby in https://github.com/gofiber/fiber/pull/3874
- Middleware/limiter: Fix default value for MaxFunc in Limiter middleware by @gaby in https://github.com/gofiber/fiber/pull/3871
- Middleware/recover: Fix recover middleware panic output formatting by @gaby in https://github.com/gofiber/fiber/pull/3816
- Middleware/session: correct fresh flag logic in getSession by @sixcolors in https://github.com/gofiber/fiber/pull/3825
- Fix spelling issues by @jsoref in https://github.com/gofiber/fiber/pull/3813
- Fix fatal error calls in adapter_test.go by @ReneWerner87 in https://github.com/gofiber/fiber/pull/3810
- Fix usage of runtime RO data for ppc64 and s390x platforms by @gaby in https://github.com/gofiber/fiber/pull/3772
- Respect DisablePathNormalizing during client requests by @gaby in https://github.com/gofiber/fiber/pull/3773
- Always close form file by @arturmelanchyk in https://github.com/gofiber/fiber/pull/3786
- Fix gocritic httpNoBody and hugeParam issues by @ReneWerner87 in https://github.com/gofiber/fiber/pull/3855
- Prevent memory corruption in internal memory storage from pooled buffers by @sixcolors in https://github.com/gofiber/fiber/pull/3828
- Avoid writing into released Response in core::execFunc() by @arturmelanchyk in https://github.com/gofiber/fiber/pull/3830
- Remove Flash Cookie from Response headers after parsing by @gaby in https://github.com/gofiber/fiber/pull/3840
- Fix binder splitting for pointer-backed slice fields by @gaby in https://github.com/gofiber/fiber/pull/3844
- Execute middleware routes when handling errors by @gaby in https://github.com/gofiber/fiber/pull/3846
- fix copying of key/values in internal/memory by @sixcolors in https://github.com/gofiber/fiber/pull/3829
- Fix maintain CustomCtx across middlewares by @ReneWerner87 in https://github.com/gofiber/fiber/pull/3852
- Enhance Body handling in setConfigToRequest for better type su… by @K0ng2 in https://github.com/gofiber/fiber/pull/3820
- Replace release-drafter autolabel with fuxingloh/multi-labeler by @gaby in https://github.com/gofiber/fiber/pull/3872
- Golangci-lint issue for go1.25.0 by @laughing-nerd in https://github.com/gofiber/fiber/pull/3775
- Add automation for v3 label assignments by @ReneWerner87 in https://github.com/gofiber/fiber/pull/3845
- Update workflow path filters for Go module changes by @ReneWerner87 in https://github.com/gofiber/fiber/pull/3856
- Improvements to GitHub Workflows by @gaby in https://github.com/gofiber/fiber/pull/3857
- Update release-drafter workflow by @gaby in https://github.com/gofiber/fiber/pull/3860
- Add support for codespell in spell-check workflow by @gaby in https://github.com/gofiber/fiber/pull/3850
- Add spell check CI workflow by @gaby in https://github.com/gofiber/fiber/pull/3814
- Fix autolabeler for release-drafter by @gaby in https://github.com/gofiber/fiber/pull/3865
- Enable manual workflow dispatch for CI by @ReneWerner87 in https://github.com/gofiber/fiber/pull/3881
- build(deps): bump github.com/valyala/fasthttp from 1.65.0 to 1.67.0 by @dependabot[bot] in https://github.com/gofiber/fiber/pull/3790
- build(deps): bump golang.org/x/net from 0.44.0 to 0.45.0 by @dependabot[bot] in https://github.com/gofiber/fiber/pull/3791
- build(deps): bump github/codeql-action from 3 to 4 by @dependabot[bot] in https://github.com/gofiber/fiber/pull/3792
- build(deps): bump golang.org/x/text from 0.29.0 to 0.30.0 by @dependabot[bot] in https://github.com/gofiber/fiber/pull/3797
- build(deps): bump golang.org/x/crypto from 0.42.0 to 0.43.0 by @dependabot[bot] in https://github.com/gofiber/fiber/pull/3796
- build(deps): bump golang.org/x/net from 0.45.0 to 0.46.0 by @dependabot[bot] in https://github.com/gofiber/fiber/pull/3795
- build(deps): bump actions/setup-node from 5 to 6 by @dependabot[bot] in https://github.com/gofiber/fiber/pull/3804
- build(deps): bump github.com/shamaton/msgpack/v2 from 2.3.1 to 2.4.0 by @dependabot[bot] in https://github.com/gofiber/fiber/pull/3808
- build(deps): bump github.com/valyala/fasthttp from 1.67.0 to 1.68.0 by @dependabot[bot] in https://github.com/gofiber/fiber/pull/3819
- build(deps): bump github.com/tinylib/msgp from 1.4.0 to 1.5.0 by @dependabot[bot] in https://github.com/gofiber/fiber/pull/3823
- build(deps): bump github.com/gofiber/utils/v2 from 2.0.0-rc.1 to 2.0.0-rc.2 by @dependabot[bot] in https://github.com/gofiber/fiber/pull/3853
- build(deps): bump golang.org/x/crypto from 0.43.0 to 0.44.0 by @dependabot[bot] in https://github.com/gofiber/fiber/pull/3863
- build(deps): bump golang.org/x/net from 0.46.0 to 0.47.0 by @dependabot[bot] in https://github.com/gofiber/fiber/pull/3861
- build(deps): bump github/codeql-action from 4.31.2 to 4.31.3 by @dependabot[bot] in https://github.com/gofiber/fiber/pull/3866
- build(deps): bump DavidAnson/markdownlint-cli2-action from 20.0.0 to 21.0.0 by @dependabot[bot] in https://github.com/gofiber/fiber/pull/3873
- build(deps): bump actions/checkout from 5.0.0 to 5.0.1 - by @dependabot[bot] in https://github.com/gofiber/fiber/pull/3877
- build(deps): bump github/codeql-action from 4.31.3 to 4.31.4 by @dependabot[bot] in https://github.com/gofiber/fiber/pull/3878
- Fix typos in some files by @khanhkhanhlele in https://github.com/gofiber/fiber/pull/3847
- Document usage of reverse proxies for SendEarlyHints by @akilesh1706 in https://github.com/gofiber/fiber/pull/3778
- Fix broken link in the Routing guide by @guerzon in https://github.com/gofiber/fiber/pull/3831
- @akilesh1706 made their first contribution in https://github.com/gofiber/fiber/pull/3778
- @laughing-nerd made their first contribution in https://github.com/gofiber/fiber/pull/3775
- @jsoref made their first contribution in https://github.com/gofiber/fiber/pull/3812
- @K0ng2 made their first contribution in https://github.com/gofiber/fiber/pull/3820
- @guerzon made their first contribution in https://github.com/gofiber/fiber/pull/3831
- @khanhkhanhlele made their first contribution in https://github.com/gofiber/fiber/pull/3847
A fully-detailed view of all new features and the migration guide is available in our https://docs.gofiber.io/next/whats_new
Full Changelog: https://github.com/gofiber/fiber/compare/v3.0.0-rc.2...v3.0.0-rc.3
v2.52.10
- Handle invalid path in filesystem by @rokostik in https://github.com/gofiber/fiber/pull/3688
- Fix recover middleware panic output formatting by @ReneWerner87 in https://github.com/gofiber/fiber/pull/3818
- Fix enforcement of Immutable config for some edge cases by @gaby in https://github.com/gofiber/fiber/pull/3835
- Document RoutePatternMatch by @ReneWerner87 in https://github.com/gofiber/fiber/pull/3723
- @rokostik made their first contribution in https://github.com/gofiber/fiber/pull/3688
Full Changelog: https://github.com/gofiber/fiber/compare/v2.52.9...v2.52.10
Release 1.77.0
- mem: Replace the
Readerinterface with a struct for better performance and maintainability. (#8669)
- balancer/pickfirst: Remove support for the old
pick_firstLB policy via the environment variableGRPC_EXPERIMENTAL_ENABLE_NEW_PICK_FIRST=false. The newpick_firsthas been the default sincev1.71.0. (#8672)
- xdsclient: Fix a race condition in the ADS stream implementation that could result in
resource-not-founderrors, causing the gRPC client channel to move toTransientFailure. (#8605) - client: Ignore HTTP status header for gRPC streams. (#8548)
- client: Set a read deadline when closing a transport to prevent it from blocking indefinitely on a broken connection. (#8534)
- Special Thanks: @jgold2-stripe
- client: Fix a bug where default port 443 was not automatically added to addresses without a specified port when sent to a proxy.
- Setting environment variable
GRPC_EXPERIMENTAL_ENABLE_DEFAULT_PORT_FOR_PROXY_TARGET=falsedisables this change; please file a bug if any problems are encountered as we will remove this option soon. (#8613)
- Setting environment variable
- balancer/pickfirst: Fix a bug where duplicate addresses were not being ignored as intended. (#8611)
- server: Fix a bug that caused overcounting of channelz metrics for successful and failed streams. (#8573)
- Special Thanks: @hugehoo
- balancer/pickfirst: When configured, shuffle addresses in resolver updates that lack endpoints. Since gRPC automatically adds endpoints to resolver updates, this bug only affects custom LB policies that delegate to
pick_firstbut don't set endpoints. (#8610) - mem: Clear large buffers before re-using. (#8670)
- transport: Reduce heap allocations to reduce time spent in garbage collection. (#8624, #8630, #8639, #8668)
- transport: Avoid copies when reading and writing Data frames. (#8657, #8667)
- mem: Avoid clearing newly allocated buffers. (#8670)
- outlierdetection: Add metrics specified in gRFC A91. (#8644)
- Special Thanks: @davinci26, @PardhuKonakanchi
- stats/opentelemetry: Add support for optional label
grpc.lb.backend_servicein per-call metrics (#8637) - xds: Add support for JWT Call Credentials as specified in gRFC A97. Set environment variable
GRPC_EXPERIMENTAL_XDS_BOOTSTRAP_CALL_CREDS=trueto enable this feature. (#8536)- Special Thanks: @dimpavloff
- experimental/stats: Add support for up/down counters. (#8581)
v4.5.0
This release contains new features, improvements and bug fix.
- US-1151 Add API integration with Tesseract OCR
- US-1197 Add support for rendering text using OTF font
- US-1178 Add PDF/A validation scripts for PDF/A-4 and it’s variants (PDF/A-4e and PDF/A-4f)
- US-1173 Add `PieceInfo` in Document catalog
- US-201 Support unicode segmentations before encoding the rune into charcodes
- US-1208 PDF/A-4 add testdata for 4F and 4E profiles into unipdf-testdata
- US-1209 PDF/A-4 add pdfaid rev support in PDF metadata
- US-1214 High memory usage when rendering PDF with large font size to image fix
v1.11.0
Note that Go1.24 is now required (use goquery < 1.11.0 if you can't use go1.24+).
v1.9.3
We are excited to announce the release of go-zero v1.9.3! This release brings several important enhancements and bug fixes that improve the framework's reliability, performance, and alignment with industry best practices.
- Consistent Hash Load Balancing: New gRPC load balancer for session affinity
- gRPC Best Practices: Changed NonBlock default to align with gRPC recommendations
- Improved Distributed Tracing: Fixed gateway trace header propagation
- ORM Improvements: Fixed zero value scanning for pointer destinations
Contributor: @zhoushuguang
A new consistent hash load balancer has been added to the zRPC package, enabling session affinity for gRPC services.
Key Features:
- Hash-based request routing to maintain session affinity
- Distributes requests based on a hash key from context
- Minimal request redistribution on node changes
- Built on go-zero's existing
core/hash/ConsistentHashimplementation
Usage Example:
// Set hash key in context
ctx := zrpc.SetHashKey(ctx, "user_123")
// Requests with the same key will be routed to the same backend
resp, err := client.SomeMethod(ctx, req)
Configuration:
c := zrpc.RpcClientConf{
Endpoints: []string{"localhost:8080", "localhost:8081"},
BalancerName: "consistent_hash", // Use consistent hash balancer
}
Benefits:
- Enables stateful service interactions
- Improves cache hit rates on backend services
- Reduces session data synchronization overhead
- Maintains load distribution while supporting affinity
Contributor: @kevwan
Fixed an issue where OpenTelemetry trace propagation headers were not being properly forwarded through the gateway to upstream gRPC services, breaking distributed tracing.
Problem: The gateway was not forwarding critical W3C Trace Context headers (traceparent, tracestate, baggage) to gRPC metadata, causing trace context to be lost at the gateway boundary.
Solution:
- Enhanced
ProcessHeadersfunction to forward trace propagation headers - Headers are now properly converted to lowercase per gRPC metadata conventions
- Maintains distributed tracing across HTTP → gRPC boundaries
Impact:
- End-to-end tracing now works correctly through the gateway
- Improved observability for microservice architectures
- Better debugging and performance analysis capabilities
Technical Details:
// Trace headers now properly forwarded
var traceHeaders = map[string]bool{
"traceparent": true, // W3C Trace Context
"tracestate": true, // Additional trace state
"baggage": true, // W3C Baggage propagation
}
Contributor: @kevwan
Problem: When running multiple services (e.g., REST + RPC) in the same process, the trace agent could be initialized multiple times, potentially causing resource leaks or unexpected behavior.
Solution:
- Used
sync.Onceto ensure trace agent is initialized only once - Aligned with similar patterns used in
prometheus.StartAgentandlogx.SetUp - Added
sync.OnceFuncfor shutdown to prevent double cleanup
Code Changes:
var (
once sync.Once
shutdownOnceFn = sync.OnceFunc(func() {
if tp != nil {
_ = tp.Shutdown(context.Background())
}
})
)
func StartAgent(c Config) {
if c.Disabled {
return
}
once.Do(func() {
if err := startAgent(c); err != nil {
logx.Error(err)
}
})
}
Benefits:
- Prevents resource conflicts in multi-server processes
- Ensures single global tracer provider instance
- Safer concurrent initialization
- Proper cleanup on shutdown
Contributor: @lerity-yao (first contribution! 🎊)
Problem: When scanning database results into struct fields with pointer types, zero values (0, false, empty string) were not being properly distinguished from NULL values. This caused nil pointers to be set to zero values incorrectly.
Solution: Enhanced the getValueInterface function to properly initialize nil pointers before scanning, ensuring the SQL driver can correctly populate them with zero or non-zero values.
Code Changes:
func getValueInterface(value reflect.Value) (any, error) {
if !value.CanAddr() || !value.Addr().CanInterface() {
return nil, ErrNotReadableValue
}
// Initialize nil pointer before scanning
if value.Kind() == reflect.Pointer && value.IsNil() {
baseValueType := mapping.Deref(value.Type())
value.Set(reflect.New(baseValueType))
}
return value.Addr().Interface(), nil
}
Impact:
type User struct {
Name string `db:"name"` // Always set
Age *int `db:"age"` // Can distinguish NULL vs 0
Active *bool `db:"active"` // Can distinguish NULL vs false
}
// Before: age=0 and age=NULL both resulted in nil pointer
// After: age=0 → *int(0), age=NULL → nil pointer ✓
Benefits:
- Correct handling of NULL vs zero values
- Better semantic representation of optional fields
- Prevents unexpected nil pointer dereferences
- Aligns with Go's SQL scanning best practices
Contributor: @kevwan
Motivation: Aligned with gRPC official best practices which discourage blocking dials.
Change:
// zrpc/config.go
type RpcClientConf struct {
// Before: NonBlock bool `json:",optional"`
// After:
NonBlock bool `json:",default=true"` // Now defaults to true
}
Why This Matters:
- Blocking dials are deprecated:
grpc.WithBlock()is an anti-pattern - Connection state is dynamic: Being connected at dial time doesn't guarantee future connectivity
- RPCs handle waiting: All RPCs automatically wait until connection or deadline
- Simpler code: No need to check "ready" state before making calls
Migration Guide:
For most users, no action required - the new default is the recommended behavior.
If you explicitly need blocking behavior (not recommended):
// Option 1: Configuration
c := zrpc.RpcClientConf{
NonBlock: false, // Explicit blocking
}
// Option 2: Client option (deprecated)
client := zrpc.MustNewClient(c, zrpc.WithBlock())
Backward Compatibility:
- Existing configs with
NonBlock: falsecontinue to work - New
WithBlock()option available (marked deprecated) - No changes needed for services already using
NonBlock: true
Documentation: See GRPC_NONBLOCK_CHANGE.md for detailed migration guide and rationale.
We're thrilled to welcome new contributors to the go-zero community! 🎉
- @JackGod001 - Made their first contribution in #4343
- @stemlaud - Made their first contribution in #5245
- @gfischer7 - Made their first contribution in #5254
- @lerity-yao - Made their first contribution in #5270 (ORM fix)
Thank you for your contributions! We look forward to your continued involvement in the project.
go get -u github.com/zeromicro/go-zero@v1.9.3
# Update go.mod
go get -u github.com/zeromicro/go-zero@v1.9.3
go mod tidy
- Full Changelog: https://github.com/zeromicro/go-zero/compare/v1.9.2...v1.9.3
- Documentation: https://go-zero.dev
- GitHub Repository: https://github.com/zeromicro/go-zero
- Added consistent hash balancer for gRPC (
zrpc/internal/balancer/consistenthash) - Context-based hash key API:
SetHashKey()andGetHashKey() - Configurable replica count and hash function
- Comprehensive test coverage
- Fixed trace header propagation in gateway
- Proper handling of W3C Trace Context headers
- Case-insensitive header matching per gRPC conventions
- Single initialization with
sync.Oncepattern
- Fixed pointer field scanning for zero values
- Proper NULL vs zero value distinction
- Enhanced
getValueInterface()with nil pointer initialization - Support for
sql.Null*types
- Changed NonBlock default to true
- Added deprecated
WithBlock()option for compatibility - Explicit handling of both blocking and non-blocking modes
- Updated client initialization logic
- Added comprehensive test coverage for all changes
- Edge case handling in ORM tests
- Gateway trace header test cases
- Consistent hash balancer benchmarks
Special thanks to all contributors, issue reporters, and community members who made this release possible. Your feedback and contributions continue to make go-zero better!
If you encounter any issues or have suggestions for future releases, please:
- Open an issue: https://github.com/zeromicro/go-zero/issues
Happy coding with go-zero! 🚀
Wails v3.0.0-alpha.40
- Fix Windows systray icon not defaulting to application icon when no custom icon is provided (#4704)
🤖 This is an automated nightly release generated from the latest changes in the v3-alpha branch.
Installation:
go install github.com/wailsapp/wails/v3/cmd/wails3@v3.0.0-alpha.40