From 575167f0f968727449622ceda07f7f3ca19d2b85 Mon Sep 17 00:00:00 2001 From: maru Date: Fri, 29 Dec 2023 14:38:12 -0500 Subject: [PATCH] Simplify error return in GetUsernameFromToken --- db/account.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/db/account.go b/db/account.go index 76866a1..534e814 100644 --- a/db/account.go +++ b/db/account.go @@ -28,10 +28,6 @@ func GetUsernameFromToken(token []byte) (string, error) { var username string err := handle.QueryRow("SELECT a.username FROM accounts a JOIN sessions s ON s.uuid = a.uuid WHERE s.token = ? AND s.expire > UTC_TIMESTAMP()", token).Scan(&username) if err != nil { - if err == sql.ErrNoRows { - return "", err - } - return "", err }