hugobot/utils/print.go

15 lines
195 B
Go
Raw Normal View History

2019-04-10 13:13:33 +00:00
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
}