Skip to content
Myr

use return not use else (#1028)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by 田欧 · committed by Bo-Yi Wu · parent 8f86194 · Browse files · 1 file+6 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+6 added−4 removed

  • other:+6 added−4 removed

1 file+6 added−4 removed

modified:auth.go+6 added-4 removed
50 unmodified lines
51 if !found {52 // Credentials doesn't match, we return 401 and abort handlers chain.53 c.Header("WWW-Authenticate", realm)54 c.AbortWithStatus(401)55 } else {56 // The user credentials was found, set user's id to key AuthUserKey in this context, the userId can be read later using57 // c.MustGet(gin.AuthUserKey)58 c.Set(AuthUserKey, user)55 return56 }5758 // The user credentials was found, set user's id to key AuthUserKey in this context, the user's id can be read later using59 // c.MustGet(gin.AuthUserKey)60 c.Set(AuthUserKey, user)61 return62 }63}6465// BasicAuth returns a Basic HTTP Authorization middleware. It takes as argument a map[string]string where
31 unmodified lines