mirror of
https://github.com/bmc-toolbox/bmclib.git
synced 2025-06-03 05:14:43 +00:00
24 lines
443 B
Go
24 lines
443 B
Go
package internal
|
|
|
|
import (
|
|
"unicode"
|
|
)
|
|
|
|
// IsntLetterOrNumber check if the give rune is not a letter nor a number
|
|
func IsntLetterOrNumber(c rune) bool {
|
|
return !unicode.IsLetter(c) && !unicode.IsNumber(c)
|
|
}
|
|
|
|
func IsRoleValid(role string) bool {
|
|
return role == "admin" || role == "user" || role == "operator"
|
|
}
|
|
|
|
func StringInSlice(str string, sl []string) bool {
|
|
for _, s := range sl {
|
|
if str == s {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|