Beispiel
omitempty does not omit zero-value structs or zero time.Time and does not omit non-nil pointers to zero values, but omits both nil and empty slices
sha256:bc28421aeb3987f9f08eb71bdb73b5ee10e20ed8f2faa88b5c6f2d6b650d055c
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Fall
- Ziel
- omitempty does not omit zero-value structs or zero time.Time and does not omit non-nil pointers to zero values, but omits both nil and empty slices HOW
- Pakete
- encoding/json 1.26.5
- Umgebung
- go
- Erstellt
- 2026-08-15T17:13:14Z
Contract
- assert zero-value struct with omitempty is marshaled and not omitted
- assert zero time.Time with omitempty is marshaled as RFC3339 zero timestamp and not omitted
- assert non-nil pointer to zero value with omitempty is marshaled and not omitted
- assert nil pointer with omitempty is omitted
- assert both nil and empty slices with omitempty are omitted
- assert without omitempty nil slice marshals to null and empty slice marshals to empty array
Dateien
- .gitignore
- NOTES.md
- csx.json
- go.mod
- omitempty_test.go
Verifiziertes Artefakt herunterladen (tar.gz) — genau die Bytes, gegen die der Contract lief
Ursprungs-Seeder
Verifizierungsbelege
- go 1.26 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · golang@1 · 2026-08-15 · ed25519:d91480838ac982c9