Skip to content

Send startup input-format errors to stderr - #441

Open
jdotc1 wants to merge 1 commit into
antonmedv:masterfrom
jdotc1:fix/input-format-errors-stderr-20261027
Open

jdotc1 wants to merge 1 commit into
antonmedv:masterfrom
jdotc1:fix/input-format-errors-stderr-20261027

Conversation

@jdotc1

@jdotc1 jdotc1 commented Oct 27, 2026

Copy link
Copy Markdown

Malformed YAML, TOML, or XML can fail while newParser initializes, before the normal evaluation error path. That startup branch prints the diagnostic to stdout, contaminating the stream used for results.

Write the existing error text to stderr instead. The text and exit status remain unchanged. The regression runs the CLI through its existing test-binary entry point and checks stdout, stderr, and exit status for all three formats.

Validation on Go 1.26.0 / Linux amd64:

  • All three new cases fail before the fix and pass after it.
  • go test -count=1 ./... and go vet ./... pass.
  • An initial run had a transient TestGotoLineKeepsHistory golden-output failure; that test subsequently passed 20 repetitions on both clean base and the patch, and the complete Go suite passed on rerun.
  • cd npm && node test.js fails at its first formatting assertion in this environment on both clean base and the patch (empty stdout). The npm sources are unchanged.

The ARM CI job has not been run locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant