From 585db9aeb19fcfac4ce0fe7675bce1175e5bd7d0 Mon Sep 17 00:00:00 2001 From: juanatsap Date: Thu, 20 Nov 2025 13:23:32 +0000 Subject: [PATCH] fix: Convert if-else chains to switch statements for staticcheck QF1003 - Convert cvIcons migration logic to switch statement (line 103-110) - Convert currentIcons migration logic to switch statement (line 861-866) - Resolves golangci-lint staticcheck QF1003 warnings in GitHub Actions --- internal/handlers/cv.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/handlers/cv.go b/internal/handlers/cv.go index ddde777..79e62f9 100644 --- a/internal/handlers/cv.go +++ b/internal/handlers/cv.go @@ -100,10 +100,11 @@ func (h *CVHandler) Home(w http.ResponseWriter, r *http.Request) { cvLength = "long" setPreferenceCookie(w, "cv-length", "long") } - if cvIcons == "true" { + switch cvIcons { + case "true": cvIcons = "show" setPreferenceCookie(w, "cv-icons", "show") - } else if cvIcons == "false" { + case "false": cvIcons = "hide" setPreferenceCookie(w, "cv-icons", "hide") } @@ -857,9 +858,10 @@ func (h *CVHandler) ToggleIcons(w http.ResponseWriter, r *http.Request) { currentIcons := getPreferenceCookie(r, "cv-icons", "show") // Migrate old values if needed - if currentIcons == "true" { + switch currentIcons { + case "true": currentIcons = "show" - } else if currentIcons == "false" { + case "false": currentIcons = "hide" }