(w http.ResponseWriter, v any)
| 152 | } |
| 153 | |
| 154 | func writeJSON(w http.ResponseWriter, v any) { |
| 155 | enc := json.NewEncoder(w) |
| 156 | if indent { |
| 157 | enc.SetIndent("", " ") |
| 158 | } |
| 159 | if err := enc.Encode(v); err != nil { |
| 160 | log.Err(err).Msgf("Failed to write json encoding to response body.") |
| 161 | } |
| 162 | } |