(w http.ResponseWriter, r *http.Request)
| 15 | } |
| 16 | |
| 17 | func (h *Handler) FindByID(w http.ResponseWriter, r *http.Request) { |
| 18 | log.Println("handling READ request - Method:", r.Method) |
| 19 | monster, exists := loadMonsters()[r.PathValue("id")] |
| 20 | if !exists { |
| 21 | w.WriteHeader(http.StatusNotFound) |
| 22 | return |
| 23 | } |
| 24 | json.NewEncoder(w).Encode(monster) |
| 25 | } |
| 26 | |
| 27 | func (h *Handler) UpdateByID(w http.ResponseWriter, r *http.Request) { |
| 28 | log.Println("Handling UPDATE request - Method:", r.Method) |
nothing calls this directly
no test coverage detected