From 94ed7f8fe56f62c833d201e1d724ac711149220f Mon Sep 17 00:00:00 2001 From: rick Date: Sat, 11 Sep 2021 20:05:16 +0200 Subject: [PATCH] refactor(logs): remove useless log and just panic (close #6) --- server.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/server.go b/server.go index 94a5b13..bdd6395 100644 --- a/server.go +++ b/server.go @@ -160,7 +160,7 @@ func formHandler (c *fiber.Ctx) error { sess, _ := Session.Get(c) if sess.Get("token") == nil { - log.Panic("Vous n’êtes pas connecté à Spotify.") + panic("Vous n’êtes pas connecté à Spotify.") } token := sess.Get("token").(string) @@ -169,7 +169,7 @@ func formHandler (c *fiber.Ctx) error { e := testSpotifyPlaylist(token, tokentype, id) if e != nil { - log.Panic(e.Error()) + panic(e.Error()) } c.Set("Location", "/feudecamp") @@ -178,7 +178,6 @@ func formHandler (c *fiber.Ctx) error { } func getNew(c *fiber.Ctx) error { - /* read session */ sess, _ := Session.Get(c) c.JSON(Queue[sess.Get("token").(string)]) @@ -221,12 +220,8 @@ func spotifyCallback(c *fiber.Ctx) error { func index(c *fiber.Ctx) error { sess, _ := Session.Get(c) - tmp := false - if sess.Get("token") != nil { - tmp = true - } - - return c.Render("index", fiber.Map{"connected": tmp, "url": SpotifyURL}) + return c.Render("index", fiber.Map{"connected": sess.Get("token") != nil, + "url": SpotifyURL}) } func fdc(c *fiber.Ctx) error {