yq
The YAML/JSON/XML processor, rewritten in Go+
Current release —
v1.0.3.goforge.dev/gpyqis a Go+ reimplementation ofmikefarah/yqv4.53.3, byte-identical to the upstream binary across a broad multi-format differential battery. The installable artifact is stillyq— install withgo install goforge.dev/gpyq/cmd/yq@v1.0.3. The current line shares wildcard key matching throughstd/pathqueryand consumes Go+ stdlib v0.207.0.
GoForge yq targets mikefarah/yq v4.53.3. The whole processor — the expression
lexer/parser, the operator library, and the YAML/JSON/XML/TOML/CSV/properties/
LUA/base64/URI en/decoders — is authored in Go+ and distributed as generated
Go; consumers never need the toolchain.
Parity
yq --version reports v4.53.3 and the binary is differential-identical to
the pinned upstream binary across a ~60-case battery: path/traverse, array
index/slice/splat, sort/sort_by, keys/to_entries/from_entries,
assignment (=, |=), select/map, the .a * .b merge, env/load,
arithmetic and string ops, unique/reverse/flatten/group_by/pick, and
the multi-format round-trips -o=json/xml/toml/props/csv/tsv plus
-p=json/xml/props input. The full upstream test suite passes.
Go+ authorship
~18k lines of yq’s own logic are authored in 115 .gp source files (only the
//go:build feature-flag files — the yq_no* conditional-format stack and the
GOOS splits — stay hand-written Go), reusing the same libraries (goccy/go-yaml,
goccy/go-json, pelletier/go-toml, cobra, orderedmap). Generation is
deterministic and goplus gen -check is clean against released goplus v0.139.0.
Honest about its shape: yq introduces zero enums. Its discriminators are
wire-coupled — output-format names, node/style bitsets mirroring the YAML
library’s kinds, and a struct-valued operationType dispatch table — not scalar
sums, so the wire formats are preserved byte-for-byte rather than reshaped.
Notes
Faithful to pinned upstream MIT provenance (© 2017 Mike Farah). Third-party
dependencies are unchanged. See the repository’s PARITY.md for the parity
ledger.