A quick snippet to get some nicer debug of json and other mapped values.

1
2
3
4
5
6
7
8
//PrettyPrint print any interface
func PrettyPrint(data interface{}) (err error) {
      indentedData, err := json.MarshalIndent(data, "", "  ")
      if err == nil {
              fmt.Println(string(indentedData))
      }
      return
}