(w http.ResponseWriter, v interface{})
| 182 | } |
| 183 | |
| 184 | func writeJSON(w http.ResponseWriter, v interface{}) { |
| 185 | w.Header().Set("Content-Type", "application/json") |
| 186 | if err := json.NewEncoder(w).Encode(v); err != nil { |
| 187 | log.Printf("Error writing JSON response: %v", err) |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | func writeError(w http.ResponseWriter, code int, msg string) { |
| 192 | w.Header().Set("Content-Type", "application/json") |
no outgoing calls
no test coverage detected