Last active
November 26, 2019 02:33
-
-
Save tonyyang-svail/7dfd4407cfc62ea56152a39007f607d9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ( | |
"encoding/json" | |
"fmt" | |
) | |
func JSONPrint(i interface{}) { | |
b, err := json.MarshalIndent(i, "", " ") | |
if err != nil { | |
fmt.Println("error:", err) | |
} | |
fmt.Print(string(b)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment