From dc2eab709ed3b8f3d3ecdd3652a5c101080f5e3b Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Tue, 20 Jul 2021 01:35:04 +0700 Subject: [PATCH] fix: total would always return error before --- api/app/v1/handler/joke_total.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/api/app/v1/handler/joke_total.go b/api/app/v1/handler/joke_total.go index eee7af5..9e473d7 100644 --- a/api/app/v1/handler/joke_total.go +++ b/api/app/v1/handler/joke_total.go @@ -3,7 +3,6 @@ package handler import ( "jokes-bapak2-api/app/v1/core" "jokes-bapak2-api/app/v1/models" - "log" "strconv" "github.com/gofiber/fiber/v2" @@ -23,7 +22,7 @@ func TotalJokes(c *fiber.Ctx) error { } total, err := memory.Get("total") - log.Println(err) + if err != nil { if err.Error() == "Entry not found" { return c.Status(fiber.StatusInternalServerError).JSON(models.Error{