Lightweight and easily self-hostable Git forge. git.poy.ooo
git-forge selfhosting homebrew
Something went wrong. Try again.
12345678910111213141516171819202122232425package lib
import "regexp"
var HandleRegex = regexp.MustCompile("^[a-z0-9_]+(-[a-z0-9_]+)*$")
const HandleMinLength = 3const HandleMaxLength = 30
// validates a handle.func ValidateHandle(s string) bool { // check if the format is correct using the regex if !HandleRegex.MatchString(s) { return false }
// length constraint? length := len(s) if length < HandleMinLength || length > HandleMaxLength { return false }
return true}