From da249a770d4b691c1f94a9df2638e0e052b717b5 Mon Sep 17 00:00:00 2001 From: Jeff Rose Date: Wed, 14 Jan 2026 23:12:53 -0800 Subject: [PATCH] Apply suggested fix to internal/infrastructure/output/yaml.go from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- internal/infrastructure/output/yaml.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/internal/infrastructure/output/yaml.go b/internal/infrastructure/output/yaml.go index 7e378be..c3e2ea9 100644 --- a/internal/infrastructure/output/yaml.go +++ b/internal/infrastructure/output/yaml.go @@ -42,9 +42,12 @@ func (f *YAMLFormatter) Format(result *execution.ExecutionResult) error { encoder := yaml.NewEncoder(f.writer, yaml.Indent(f.indent)) - if err := encoder.Encode(out); err != nil { - return err + encodeErr := encoder.Encode(out) + closeErr := encoder.Close() + + if encodeErr != nil { + return encodeErr } - return encoder.Close() + return closeErr }