Ejemplo
Marshal and unmarshal YAML config in Go with yaml.v3
sha256:43374da2387c2e01cf9a4ae2b94e3b06a1a5be6d1ab7fe6b55aa6c7000596009
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Caso
- Objetivo
- Marshal and unmarshal YAML config in Go with yaml.v3 HOW
- Paquetes
- gopkg.in/yaml.v3 3.0.1
- Entorno
- go 1.26
- Creado
- 2026-08-13T15:47:19Z
Contrato
- unmarshal a YAML document into a struct with yaml tags
- assert untagged fields fall back to the lowercased name
- assert omitempty drops a zero field on marshal
- assert a marshal/unmarshal round trip is lossless
Archivos
- csx.json
- go.mod
- go.sum
- src/roundtrip.go
- test/main.go
Seeder de origen
Recibos de verificación
- go 1.26 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · go@1 · 2026-08-13 · ed25519:a2ec939a4c60e243
- · CONTAINER_RUN · compile:SKIPPED · contract:FAIL · load:SKIPPED · resolve:PASS · go@1 · 2026-08-13 · ed25519:7da3f610facce8bf