kopia lustrzana https://github.com/reiver/greatape
18 wiersze
318 B
Go
18 wiersze
318 B
Go
package validators
|
|
|
|
import . "github.com/reiver/greatape/components/constants"
|
|
|
|
func UsernameIsValid(username string) bool {
|
|
if !REGEXP_USERNAME.MatchString(username) {
|
|
return false
|
|
}
|
|
|
|
for _, reservedUsername := range ReservedUsernames {
|
|
if username == reservedUsername {
|
|
return false
|
|
}
|
|
}
|
|
|
|
return true
|
|
}
|