Skip to content

v1.10.3

Released on 2026-08-01 - GitHub Release

FirstN iterated runes with a counter that could never equal a negative n, so it silently returned the entire input string instead of an empty one. An early-return guard now makes negative lengths behave predictably:

if n < 0 {
return ""
}

stringxSubstr rejects start > stop to prevent a slice panic (#5616)

Section titled “stringx — Substr rejects start > stop to prevent a slice panic (#5616)”

Substr validated start and stop individually against [0, length] but never checked that start <= stop. Calls like Substr("hello", 3, 2) slipped past both guards and panicked on rs[3:2]. start > stop is now treated as an invalid stop position, returning ErrInvalidStopPosition instead of panicking.

httpx.Parse failed to unmarshal pointer-to-slice fields (e.g. *[]uint64). fillSlice used fieldType.Elem(), which for *[]T resolves to []T instead of T, causing type mismatch errors on JSON arrays such as [9000, 9001]. The field type is now dereferenced before resolving the slice element type.

redis — Fixed circuit breaker tripping under high concurrency (#5654)

Section titled “redis — Fixed circuit breaker tripping under high concurrency (#5654)”

The DisableIdentity and Protocol fields are now passed through to go-redis, and MaintNotifications is disabled by default since the CLIENT MAINT_NOTIFICATIONS command is unsupported on open-source Redis. This resolves circuit breaker trips under high concurrency or against incompatible Redis servers.

core/collection.Queue previously grew its backing slice by the initial queue size each time it filled up, resulting in O(n²) total copy work for small initial capacities. The new implementation uses a Go-slice-like growth curve — doubling small queues and easing toward 1.25x growth for larger ones — while preserving FIFO order for wrapped ring buffers, clearing dequeued slots so the GC can reclaim referenced objects, and rejecting non-positive initial capacities.

New methods update a consumer group’s last-delivered ID on a stream:

lastID, err := client.XGroupSetIDCtx(ctx, "mystream", "mygroup", "$")
  • go-redis/v9 9.19.0 → 9.21.0
  • mongo-driver/v2 2.6.0 → 2.8.0
  • pelletier/go-toml/v2 2.3.1 → 2.4.3

Full Changelog: https://github.com/zeromicro/go-zero/compare/v1.10.2…v1.10.3