From 2938f26f3a28608a9b409f7f91e47da286b82441 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sat, 20 May 2023 06:28:23 +0400 Subject: [PATCH] Fixed misplaced if err != nil {} in mindflow page handlers. --- internal/http/handlers.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/internal/http/handlers.go b/internal/http/handlers.go index 79e5c5e..001aef7 100644 --- a/internal/http/handlers.go +++ b/internal/http/handlers.go @@ -53,24 +53,24 @@ func (h *Handlers) Stuff(w http.ResponseWriter, r *http.Request) { func (h *Handlers) Mindflow(w http.ResponseWriter, r *http.Request) { posts, err := h.mindflowDB.GetAll() - for _, entry := range posts { - entry.Body = strings.ReplaceAll(entry.Body, "\\n", "\n") - } if err != nil { return } + for _, entry := range posts { + entry.Body = strings.ReplaceAll(entry.Body, "\\n", "\n") + } web.Mindflow("/ Mindflow", posts, r, w) } func (h *Handlers) MindflowAdmin(w http.ResponseWriter, r *http.Request) { posts, err := h.mindflowDB.GetAll() - for _, entry := range posts { - entry.Body = strings.ReplaceAll(entry.Body, "\\n", "\n") - } if err != nil { return } + for _, entry := range posts { + entry.Body = strings.ReplaceAll(entry.Body, "\\n", "\n") + } web.MindflowAdmin("/ Mindflow Administration", posts, r, w) }