From c4db7098c0eb1973c843c69d67f823bba7980a0c Mon Sep 17 00:00:00 2001 From: Umputun Date: Sun, 15 Jan 2023 18:47:13 -0600 Subject: [PATCH] lint: minor warn about order of compare --- basic_auth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/basic_auth.go b/basic_auth.go index f63d9ce..f5d7777 100644 --- a/basic_auth.go +++ b/basic_auth.go @@ -43,5 +43,5 @@ func BasicAuthWithUserPasswd(user, passwd string) func(http.Handler) http.Handle // it can be used in handlers to check if BasicAuth middleware was applied func IsAuthorized(ctx context.Context) bool { v := ctx.Value(contextKey(baContextKey)) - return nil != v && v.(bool) + return v != nil && v.(bool) }