1234567891011121314151617181920 |
- package discordgo
- import (
- "bytes"
- "encoding/json"
- "fmt"
- )
- func printJSON(body []byte) {
- var prettyJSON bytes.Buffer
- error := json.Indent(&prettyJSON, body, "", "\t")
- if error != nil {
- fmt.Print("JSON parse error: ", error)
- }
- fmt.Println(string(prettyJSON.Bytes()))
- }
|