(w http.ResponseWriter, msg string, code int)
| 67 | } |
| 68 | |
| 69 | func apiError(w http.ResponseWriter, msg string, code int) { |
| 70 | w.Header().Set("Content-Type", "application/json") |
| 71 | w.WriteHeader(code) |
| 72 | json.NewEncoder(w).Encode(map[string]any{"message": msg, "code": code}) |
| 73 | } |
| 74 | |
| 75 | // listResponse wraps data with pagination metadata. |
| 76 | func listResponse(data any, total, page, limit int) map[string]any { |
no test coverage detected