--- Helpers ---
(w http.ResponseWriter, status int, data any)
| 547 | // --- Helpers --- |
| 548 | |
| 549 | func writeJSON(w http.ResponseWriter, status int, data any) { |
| 550 | w.Header().Set("Content-Type", "application/json") |
| 551 | w.WriteHeader(status) |
| 552 | json.NewEncoder(w).Encode(data) |
| 553 | } |
| 554 | |
| 555 | func writeError(w http.ResponseWriter, status int, message, details string) { |
| 556 | writeJSON(w, status, ErrorResponse{ |
no outgoing calls
no test coverage detected