mirror of
https://github.com/portainer/portainer.git
synced 2025-08-02 20:35:25 +02:00
remove deprecated random seed and other minor staticcheck errors (#10851)
This commit is contained in:
parent
52fe09d0b1
commit
5f1f797281
4 changed files with 10 additions and 7 deletions
|
@ -200,7 +200,7 @@ func (handler *Handler) syncUserTeamsWithLDAPGroups(user *portainer.User, settin
|
|||
|
||||
func teamExists(teamName string, ldapGroups []string) bool {
|
||||
for _, group := range ldapGroups {
|
||||
if strings.ToLower(group) == strings.ToLower(teamName) {
|
||||
if strings.EqualFold(group, teamName) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,15 @@ import (
|
|||
"github.com/gorilla/mux"
|
||||
)
|
||||
|
||||
const contextEndpoint = "endpoint"
|
||||
// Note: context keys must be distinct types to prevent collisions. They are NOT key/value map's internally
|
||||
// See: https://go.dev/blog/context#TOC_3.2.
|
||||
|
||||
// This avoids staticcheck error:
|
||||
// SA1029: should not use built-in type string as key for value; define your own type to avoid collisions (staticcheck)
|
||||
// https://stackoverflow.com/questions/40891345/fix-should-not-use-basic-type-string-as-key-in-context-withvalue-golint
|
||||
type key int
|
||||
|
||||
const contextEndpoint key = 0
|
||||
|
||||
func WithEndpoint(endpointService dataservices.EndpointService, endpointIDParam string) mux.MiddlewareFunc {
|
||||
return func(next http.Handler) http.Handler {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue