(w http.ResponseWriter, status int, msg string, details []string)
| 373 | } |
| 374 | |
| 375 | func writeError(w http.ResponseWriter, status int, msg string, details []string) { |
| 376 | w.Header().Set("Content-Type", "application/json") |
| 377 | w.WriteHeader(status) |
| 378 | json.NewEncoder(w).Encode(ErrorResponse{Error: msg, Details: details}) //nolint:errcheck |
| 379 | } |
| 380 | |
| 381 | func findTaskByID(tasks []*model.Task, id string) *model.Task { |
| 382 | for _, t := range tasks { |
no outgoing calls
no test coverage detected