Skip to content

Commit

Permalink
lint: minor warn about order of compare
Browse files Browse the repository at this point in the history
  • Loading branch information
umputun committed Jan 16, 2023
1 parent 21c9dc2 commit c4db709
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion basic_auth.go
Expand Up @@ -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)
}

0 comments on commit c4db709

Please sign in to comment.