(w http.ResponseWriter, v any)
| 951 | } |
| 952 | |
| 953 | func (h *Handler) writeJSON(w http.ResponseWriter, v any) { |
| 954 | w.Header().Set("Content-Type", "application/json") |
| 955 | enc := json.NewEncoder(w) |
| 956 | enc.SetIndent("", " ") |
| 957 | if err := enc.Encode(v); err != nil { |
| 958 | h.logger.Errorf("encode JSON response: %v", err) |
| 959 | } |
| 960 | } |
no test coverage detected