import "github.com/webermarci/validator"
v := validator.NewValidator().StartsWith("123")
result := v.Validate("abc123")
fmt.Println(result.Approval)
// False
fmt.Println(result.RuleType)
// startsWith
fmt.Println(result.Reason)
// "starts with 123" is not met by "abc123"
result = v.Validate("123abc")
fmt.Println(result.Approval)
// True
-
Notifications
You must be signed in to change notification settings - Fork 0
It's a simple string validator
License
webermarci/validator
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
It's a simple string validator