(v any)
| 89 | } |
| 90 | |
| 91 | func formatJSON(v any) string { |
| 92 | buf := &bytes.Buffer{} |
| 93 | enc := json.NewEncoder(buf) |
| 94 | enc.SetEscapeHTML(false) |
| 95 | err := enc.Encode(v) |
| 96 | if err != nil { |
| 97 | panic(err) |
| 98 | } |
| 99 | |
| 100 | // Remove the trailing new line added by the encoder |
| 101 | return strings.TrimSpace(buf.String()) |
| 102 | } |
| 103 | |
| 104 | // joinElements joins a slice of items with the given separator. It uses |
| 105 | // [strings.Join] if it's a slice of strings, otherwise uses [fmt.Sprint] |
nothing calls this directly
no test coverage detected
searching dependent graphs…