mirror of
https://github.com/fleetdm/fleet
synced 2026-05-06 06:48:54 +00:00
14 lines
259 B
Go
14 lines
259 B
Go
package test
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
)
|
|
|
|
func PrettyPrintJSON(prefix string, v any) {
|
|
bytes, err := json.MarshalIndent(v, "", " ")
|
|
if err != nil {
|
|
fmt.Printf("pretty-print JSON error: %v\n", err)
|
|
}
|
|
fmt.Println(prefix + ": " + string(bytes))
|
|
}
|