Release notes — v2.35.0
Highlights
- Go 1.27 support; minimum Go raised to 1.26 — consumers on Go 1.24/1.25 must stay on v2.34.x.
- Shared
Configno longer mixes up same-named types — two schemas defining the same named type differently could share an encoder, silently writing decimals at the wrong scale or swapping enum symbols and record fields. - No more stack overflow on recursive schemas — building a skip decoder for a self-referential record crashed at codec construction.
avrogen -fieldtype— override the generated Go type of a single field without editing the schema.- json-iterator removed — replaced by stdlib
encoding/json; the upstream repo was archived in December 2025.
Breaking changes
go.modnow requires Go 1.26 (#48). CI covers Go 1.26 and 1.27.
Features
feat(avrogen): add field type overrides(#46) — new-fieldtype record.field,goType[,import]flag (repeatable) andgen.WithFieldType/gen.Config.FieldTypes. Union fields get the type exactly as written, so nullable fields need an explicit*. Unused or duplicate overrides are errors (CLI exit code 5; library:Generator.ValidateFieldTypes()).-logicaltypenow shares the parser, so commas inside generic type brackets ([...]) are no longer treated as separators.feat: support go 1.27 and raise minimum go version to 1.26(#48) — addsgo fixmodernizers andslices/mapsrewrites. Each rewrite was benchmark-gated, and one that caused an allocation regression was reverted.
Fixes
fix(codec): key codec caches on referenced named type definitions(#54, fixes #52) —CacheFingerprint()now also hashes the definitions of externally referenced named types, and the encoder cache uses it like the decoder caches already did.Fingerprint()is unchanged, so single-object encoding, registries and compatibility checks are not affected.CacheFingerprint()values change for schemas that reference external named types; they are documented as a cache identity only.fix: add cycle detection to skip decoder for recursive schemas(#51, thanks @snakeice) — decoding into a struct that omits a recursive field (e.g.mapof the enclosing record) no longer recurses infinitely at codec construction.
Performance
perf: prebuild union skip decoders at codec construction(#53) — per-branch skip decoders are built once instead of on every value. Compared with v2.34.0: skipping["null", Record]goes from 103 to 67 ns with 0 allocs (was 3), and a recursive 10-level union list goes from 416 to 147 ns with 0 allocs (was 30).
Dependencies
refactor: replace json-iterator with stdlib encoding/json(#40) — removesjson-iterator/goandmodern-go/concurrent. Schema output is byte-identical, so canonical forms and fingerprints are unchanged.- Dependency upgrades:
klauspost/compressv1.19.2,mapstructurev2.5.0,testifyv1.12.0, and later Go-1.26-compatible tooling (#39, #48). GitHub Actions bumps (#35, #49).