File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package print
22
33import (
44 "bufio"
5+ "bytes"
56 "encoding/json"
67 "errors"
78 "fmt"
@@ -256,10 +257,15 @@ func (p *Printer) DebugInputModel(model any) {
256257func (p * Printer ) OutputResult (outputFormat string , output any , prettyOutputFunc func () error ) error {
257258 switch outputFormat {
258259 case JSONOutputFormat :
259- 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 )
260265 if err != nil {
261266 return fmt .Errorf ("marshal json: %w" , err )
262267 }
268+ details := buffer .Bytes ()
263269 p .Outputln (string (details ))
264270
265271 return nil
You can’t perform that action at this time.
0 commit comments