fix gopls lintings
This commit is contained in:
parent
a2e2ba39f9
commit
dd2412463b
7 changed files with 19 additions and 25 deletions
|
|
@ -2,6 +2,7 @@ package authorize
|
|||
|
||||
import (
|
||||
"net/http"
|
||||
"slices"
|
||||
|
||||
"github.com/go-chi/render"
|
||||
|
||||
|
|
@ -24,10 +25,5 @@ func RequiresRole(role string) func(next http.Handler) http.Handler {
|
|||
}
|
||||
|
||||
func hasRole(role string, roles []string) bool {
|
||||
for _, r := range roles {
|
||||
if r == role {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
return slices.Contains(roles, role)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue