(w http.ResponseWriter, v any)
| 86 | } |
| 87 | |
| 88 | func writeJSON(w http.ResponseWriter, v any) { |
| 89 | w.Header().Set("Content-Type", "application/json") |
| 90 | enc := json.NewEncoder(w) |
| 91 | enc.SetIndent("", " ") |
| 92 | if err := enc.Encode(v); err != nil { |
| 93 | http.Error(w, err.Error(), http.StatusInternalServerError) |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | // TaskDetail includes the body field for individual task detail views |
| 98 | type TaskDetail struct { |
no test coverage detected