We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e2123e2 commit a813ac9Copy full SHA for a813ac9
internal/pkg/print/print.go
@@ -2,6 +2,7 @@ package print
2
3
import (
4
"bufio"
5
+ "bytes"
6
"encoding/json"
7
"errors"
8
"fmt"
@@ -256,7 +257,12 @@ func (p *Printer) DebugInputModel(model any) {
256
257
func (p *Printer) OutputResult(outputFormat string, output any, prettyOutputFunc func() error) error {
258
switch outputFormat {
259
case JSONOutputFormat:
- details, err := json.MarshalIndent(output, "", " ")
260
+ buffer := &bytes.Buffer{}
261
+ encoder := json.NewEncoder(buffer)
262
+ encoder.SetEscapeHTML(false)
263
+ encoder.SetIndent("", " ")
264
+ err := encoder.Encode(output)
265
+ details := buffer.Bytes()
266
if err != nil {
267
return fmt.Errorf("marshal json: %w", err)
268
}
0 commit comments