From aeb4c6a780e9d0baafce646bd4b9c487e41bfe9c Mon Sep 17 00:00:00 2001 From: Jason Staten Date: Sun, 21 Aug 2022 21:28:08 -0600 Subject: [PATCH] missing returns --- main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.go b/main.go index 569ec59..961f655 100644 --- a/main.go +++ b/main.go @@ -95,11 +95,13 @@ func (s *server) HandleToggle() http.HandlerFunc { if err != nil { http.Error(w, "Bad id", http.StatusBadRequest) + return } err = s.db.ToggleTodo(id) if err != nil { http.Error(w, "failed to toggle", http.StatusInternalServerError) + return } http.Redirect(w, r, "/", http.StatusSeeOther)