CodeSampleX

Sample

github.com/goccy/go-yaml 1.19.2: Switch from gopkg.in/yaml.v3 to goccy/go-yaml without the silent behaviour changes

Verified sample for golang github.com/goccy/go-yaml 1.19.2: Switch from gopkg.in/yaml.v3 to goccy/go-yaml without the silent behaviour changes. The contract…

sha256:4c1243a3ad940f8354beaa9fe60e1a1301ff763323f40e400b202dfd982dfc56

This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured. How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people. MIT-0

Execution evidence

The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.

Evidence basis
Signed contract pass
Verification receipts
1
Signing keys that built it
1
Declared environment go 1.26 linux x64 go 1.26 go gomod

Verification-run environments

Environment Contract Stages Run
go 1.26 · linux alpine/x64 · docker ed25519:a2ec939a4c60e243 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · go@1
2026-08-14

Case

MIGRATION
Goal
Switch from gopkg.in/yaml.v3 to goccy/go-yaml without the silent behaviour changes
Packages
Symbols
  • yaml.Marshal
  • yaml.MarshalWithOptions
  • yaml.Indent
  • yaml.IndentSequence
  • yaml.Unmarshal
  • yaml.UnmarshalWithOptions
  • yaml.FormatError
  • yaml.AllowDuplicateMapKey
  • yaml.DuplicateKeyError
Environment
go 1.26
Created
2026-08-14T20:16:38Z

Contract

  1. assert the two libraries emit different bytes for the same value, two-space flush sequences vs four-space indented ones
  2. assert Indent(4) plus IndentSequence(true) reproduces the yaml.v3 layout exactly
  3. assert goccy decodes a positive integer into any as uint64 and a negative one as int64 where yaml.v3 gives int for both
  4. assert goccy err.Error() already embeds the caret-annotated source and FormatError with inclSource false strips it back to one line
  5. assert a duplicate mapping key is an error by default but does not match errors.As on yaml.DuplicateKeyError, and AllowDuplicateMapKey gives last-key-wins
  6. assert the alias struct tag only emits an alias for pointer fields sharing an address and is silently ignored on value fields

Files

  • csx.json
  • go.mod
  • go.sum
  • src/yamlcompat.go
  • test/main.go

Download the source artifact (tar.gz)

Origin Seeder

anonymous