Built-in set today: Chars / ExceptChars, MinLength / MaxLength, Email, URL, UUID, Equal, In / NotIn, the numeric Min / Max family, MinSize / MaxSize. validator/v10 ships ~100 tags; the gap is wide enough that people will hit a missing check early.
PR #9 makes a first, conservative addition, all in the existing style (constructor → func(T) error, sentinel error, table tests + Example):
Further candidates (not in the PR — worth triaging)
Between / Range for the numeric types (currently need All(Min, Max))
NotBlank — Required after strings.TrimSpace
Lower / Upper — case checks
OneOf as a readable alias for In
JSON, Base64, Hex
IP, CIDR, Hostname, Port
time bounds (Before / After) for time.Time
Keep every addition dependency-free and value-level; anything needing reflection or a struct belongs in #4.
Built-in set today: `Chars` / `ExceptChars`, `MinLength` / `MaxLength`, `Email`, `URL`, `UUID`, `Equal`, `In` / `NotIn`, the numeric `Min` / `Max` family, `MinSize` / `MaxSize`. `validator/v10` ships ~100 tags; the gap is wide enough that people will hit a missing check early.
**PR #9** makes a first, conservative addition, all in the existing style (constructor → `func(T) error`, sentinel error, table tests + Example):
- `Required[T comparable]()` — non-zero value
- `Prefix` / `Suffix` / `Contains` — `strings.HasPrefix` / `HasSuffix` / `Contains`
- `Match(*regexp.Regexp)` — arbitrary pattern
### Further candidates (not in the PR — worth triaging)
- `Between` / `Range` for the numeric types (currently need `All(Min, Max)`)
- `NotBlank` — `Required` after `strings.TrimSpace`
- `Lower` / `Upper` — case checks
- `OneOf` as a readable alias for `In`
- `JSON`, `Base64`, `Hex`
- `IP`, `CIDR`, `Hostname`, `Port`
- time bounds (`Before` / `After`) for `time.Time`
Keep every addition dependency-free and value-level; anything needing reflection or a struct belongs in #4.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Built-in set today:
Chars/ExceptChars,MinLength/MaxLength,Email,URL,UUID,Equal,In/NotIn, the numericMin/Maxfamily,MinSize/MaxSize.validator/v10ships ~100 tags; the gap is wide enough that people will hit a missing check early.PR #9 makes a first, conservative addition, all in the existing style (constructor →
func(T) error, sentinel error, table tests + Example):Required[T comparable]()— non-zero valuePrefix/Suffix/Contains—strings.HasPrefix/HasSuffix/ContainsMatch(*regexp.Regexp)— arbitrary patternFurther candidates (not in the PR — worth triaging)
Between/Rangefor the numeric types (currently needAll(Min, Max))NotBlank—Requiredafterstrings.TrimSpaceLower/Upper— case checksOneOfas a readable alias forInJSON,Base64,HexIP,CIDR,Hostname,PortBefore/After) fortime.TimeKeep every addition dependency-free and value-level; anything needing reflection or a struct belongs in #4.