MCPcopy Index your code
hub / github.com/1Panel-dev/1Panel / checkNamePattern

Function checkNamePattern

core/init/validator/validator.go:58–65  ·  view source on GitHub ↗
(fl validator.FieldLevel)

Source from the content-addressed store, hash-verified

56}
57
58func checkNamePattern(fl validator.FieldLevel) bool {
59 value := fl.Field().String()
60 result, err := regexp.MatchString("^[a-zA-Z\u4e00-\u9fa5]{1}[a-zA-Z0-9_\u4e00-\u9fa5]{0,30}$", value)
61 if err != nil {
62 global.LOG.Errorf("regexp matchString failed, %v", err)
63 }
64 return result
65}
66
67func checkIpPattern(fl validator.FieldLevel) bool {
68 value := fl.Field().String()

Callers

nothing calls this directly

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected