15 lines
195 B
Go
15 lines
195 B
Go
|
package utils
|
||
|
|
||
|
import (
|
||
|
"encoding/json"
|
||
|
"fmt"
|
||
|
)
|
||
|
|
||
|
func PrettyPrint(v interface{}) (err error) {
|
||
|
b, err := json.MarshalIndent(v, "", " ")
|
||
|
if err == nil {
|
||
|
fmt.Println(string(b))
|
||
|
}
|
||
|
return
|
||
|
}
|