SHARE
TWEET

Untitled

a guest Sep 11th, 2019 99 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package utils
  2.  
  3. import (
  4.     "encoding/json"
  5.     "fmt"
  6.     "strings"
  7. )
  8.  
  9. func PrettyPrint(target ...interface{}) {
  10.     replacer := strings.NewReplacer("\t", " ", "\n", "")
  11.  
  12.     for _, t := range target {
  13.         if _t, ok := t.(string); ok {
  14.             t = replacer.Replace(_t)
  15.         }
  16.         s, _ := json.MarshalIndent(t, "", "\t")
  17.         fmt.Println(string(s))
  18.     }
  19. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top