Go 1.24 introduces the `omitzero` JSON struct tag flag as an alternative to `omitempty`. While `omitempty` skips fields with empty values (which doesn't work for structs like `time.Time`), `omitzero` skips fields whose value is the zero value — determined by calling an `IsZero() bool` method if present. This makes it straightforward to exclude zero-value time fields from JSON output without workarounds.
•1m watch time
1 Impression