Пример
Marshal and unmarshal YAML config in Go with yaml.v3
sha256:43374da2387c2e01cf9a4ae2b94e3b06a1a5be6d1ab7fe6b55aa6c7000596009
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Кейс
- Цель
- Marshal and unmarshal YAML config in Go with yaml.v3 HOW
- Пакеты
- gopkg.in/yaml.v3 3.0.1
- Окружение
- go 1.26
- Создан
- 2026-08-13T15:47:19Z
Контракт
- 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
Файлы
- csx.json
- go.mod
- go.sum
- src/roundtrip.go
- test/main.go
Исходный сидер
Квитанции проверки
- 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