If we have a JSON string and we need to prettify it without having a struct to unmarshal, we can use: package main import ( "bytes" "encoding/json" "fmt" "log" ) func PrettyJSON(str string) (string, error) { var prettyJSON bytes...
1 min read