From 8b89eb85fa9de5dfc5f46263b4e46c79e93fade4 Mon Sep 17 00:00:00 2001 From: Redmomn <109732988+Redmomn@users.noreply.github.com> Date: Sun, 6 Oct 2024 15:47:10 +0800 Subject: [PATCH] lint: make lint happy --- cmd/gocq/login.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/gocq/login.go b/cmd/gocq/login.go index 2692254d8..9c70bb5ad 100644 --- a/cmd/gocq/login.go +++ b/cmd/gocq/login.go @@ -88,13 +88,14 @@ func printQRCode(imgData []byte) { isUpWhite := img.At(x, y).(color.Gray).Y == 255 isDownWhite := utils.Ternary(y < bound-padding, img.At(x, y+1).(color.Gray).Y == 255, false) - if !isUpWhite && !isDownWhite { + switch { + case !isUpWhite && !isDownWhite: buf = append(buf, bb...) - } else if isUpWhite && !isDownWhite { + case isUpWhite && !isDownWhite: buf = append(buf, wb...) - } else if !isUpWhite { + case !isUpWhite: buf = append(buf, bw...) - } else { + default: buf = append(buf, ww...) } }