(w http.ResponseWriter, data any)
| 1347 | } |
| 1348 | |
| 1349 | func writeJSON(w http.ResponseWriter, data any) { |
| 1350 | w.Header().Set("Content-Type", "application/json") |
| 1351 | if err := json.NewEncoder(w).Encode(data); err != nil { |
| 1352 | w.Header().Set("Content-Type", "text/plain") |
| 1353 | http.Error(w, err.Error(), http.StatusInternalServerError) |
| 1354 | return |
| 1355 | } |
| 1356 | } |
searching dependent graphs…