mirror of
https://github.com/mikefarah/yq.git
synced 2026-08-24 00:04:50 +08:00
* fix: skip UTF-8 BOM when processing front matter --front-matter=process wrapped the file in a bufio.Reader without skipping a leading UTF-8 BOM, so a BOM before the opening --- meant the separator was not recognised and the opening --- was dropped from the output (data loss). Skip the BOM with utfbom.Skip before wrapping the reader, matching the CSV object decoder. * refactor: inline UTF-8 BOM skip instead of utfbom dependency per ccoVeille's review, front matter only needs UTF-8 BOM handling, not the full utfbom package. replace utfbom.Skip with a small unexported stripUTF8BOM helper and add a stdin-path regression test alongside the existing file-path one. utfbom stays in go.mod since decoder_csv_object.go still uses it for CSV decoding.