Skip to content

Commit 19d895f

Browse files
committed
shift buffer reading after err check
1 parent a813ac9 commit 19d895f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/pkg/print/print.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,10 +262,10 @@ func (p *Printer) OutputResult(outputFormat string, output any, prettyOutputFunc
262262
encoder.SetEscapeHTML(false)
263263
encoder.SetIndent("", " ")
264264
err := encoder.Encode(output)
265-
details := buffer.Bytes()
266265
if err != nil {
267266
return fmt.Errorf("marshal json: %w", err)
268267
}
268+
details := buffer.Bytes()
269269
p.Outputln(string(details))
270270

271271
return nil

0 commit comments

Comments
 (0)