From 0a6f85dec7bf67f5f176fe06e21e558a39e43ebf Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Sat, 23 May 2026 19:12:57 +0800 Subject: [PATCH] refactor(go-oidc): flatten nested if in maskToken - Move the empty-string guard to the top of maskToken - Read as a flat guard chain instead of nested conditionals --- go-oidc/main.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/go-oidc/main.go b/go-oidc/main.go index 815b20d..8cbf2d6 100644 --- a/go-oidc/main.go +++ b/go-oidc/main.go @@ -268,10 +268,10 @@ func clearCookie(w http.ResponseWriter, name string) { } func maskToken(s string) string { + if s == "" { + return "" + } if len(s) <= 8 { - if s == "" { - return "" - } return "****" } return s[:8] + "..."