fix gopls lintings

This commit is contained in:
dhax 2025-03-05 15:41:29 +01:00
parent a2e2ba39f9
commit dd2412463b
7 changed files with 19 additions and 25 deletions

View file

@ -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)
}