13 lines
176 B
Go
13 lines
176 B
Go
package output
|
|
|
|
import (
|
|
"encoding/json"
|
|
"io"
|
|
)
|
|
|
|
func printJSON(w io.Writer, data any) error {
|
|
enc := json.NewEncoder(w)
|
|
enc.SetIndent("", " ")
|
|
return enc.Encode(data)
|
|
}
|