MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / ValidateMutatorId

Function ValidateMutatorId

internal/mutators/admin.go:17–25  ·  view source on GitHub ↗
(id string)

Source from the content-addressed store, hash-verified

15var validMutatorIdPattern = regexp.MustCompile(`^[a-z][a-z0-9_-]*$`)
16
17func ValidateMutatorId(id string) error {
18 if id == "" {
19 return fmt.Errorf("mutatorid is required")
20 }
21 if !validMutatorIdPattern.MatchString(id) {
22 return fmt.Errorf("mutatorid must be lowercase alphanumeric with hyphens/underscores, starting with a letter: %q", id)
23 }
24 return nil
25}
26
27func ValidateBuffIds(ids []int) error {
28 for _, id := range ids {

Callers 1

ValidateSpecFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected