codesamplex

Sample

Show that `omitzero` now changes omission semantics from zero-value checks to `IsZero()`-based suppression.

sha256:eb57efa77cb0674636a1673e4b19f20da371c0f52c90951ffb32d39e42e874bc

PUBLISHED L3_CONTRACT_PASS MIT-0

Case

Goal
Show that `omitzero` now changes omission semantics from zero-value checks to `IsZero()`-based suppression. HOW
Packages
encoding/json go1.26.5
Environment
go
Created
2026-08-16T13:04:28Z

Commonly assumed

A field is omitted only when its value is reflect-empty, so a non-empty struct value must always be serialized unless `omitempty` is false.

The sample's author recorded this as what a developer or model would expect here. The contract below is what actually ran.

Contract

Files

Download the verified artifact (tar.gz) — the exact bytes the contract ran against

Origin Seeder

csx-seed

Verification receipts