From 33c1db5b97708c69a43431d2e227fc042ec7d945 Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Fri, 15 May 2026 09:58:36 +0200 Subject: [PATCH] style(preflight): replace if-else chain with switch (gocritic) Co-Authored-By: Claude Opus 4.7 (1M context) --- pkg/service/handlers/preflight.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/service/handlers/preflight.go b/pkg/service/handlers/preflight.go index 1e07957..deef8a8 100644 --- a/pkg/service/handlers/preflight.go +++ b/pkg/service/handlers/preflight.go @@ -147,11 +147,12 @@ func FormatPreflightGuidance(httpsListenerPort int, res Probe443Result) string { lines = append(lines, " - localhost:443: "+res.Localhost.Error) } - if res.LAN.Reachable { + switch { + case res.LAN.Reachable: lines = append(lines, fmt.Sprintf(" - %s:443 (LAN): reachable ✓", res.LANHost)) - } else if res.LANHost != "" { + case res.LANHost != "": lines = append(lines, fmt.Sprintf(" - %s:443 (LAN): %s", res.LANHost, res.LAN.Error)) - } else { + default: lines = append(lines, " - LAN: "+res.LAN.Error) }