length: add MinLengthBytes / MaxLengthBytes
MinLength/MaxLength now count runes, leaving no way to bound a string by its byte size -- still wanted for fixed-width columns and wire-format fields. Add the byte-counting pair alongside them, with their own "%d bytes" sentinels (ErrMustHaveMoreBytes / ErrMustHaveFewerBytes). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit was merged in pull request #11.
This commit is contained in:
@@ -64,7 +64,7 @@ validate.Collect(rules...)
|
||||
|---|---|
|
||||
| Compose | `All`, `Collect` |
|
||||
| Presence / equality | `Required`, `Equal`, `In`, `NotIn` |
|
||||
| String length & content | `MinLength`, `MaxLength`, `Chars`, `ExceptChars`, `Prefix`, `Suffix`, `Contains`, `Match` |
|
||||
| String length & content | `MinLength`, `MaxLength` (runes), `MinLengthBytes`, `MaxLengthBytes`, `Chars`, `ExceptChars`, `Prefix`, `Suffix`, `Contains`, `Match` |
|
||||
| Formats | `Email`, `URL`, `UUID` |
|
||||
| Numbers | `Min`, `Max`, `MinFloat32`, `MaxFloat32`, `MinFloat64`, `MaxFloat64` |
|
||||
| Slices | `MinSize`, `MaxSize` |
|
||||
|
||||
Reference in New Issue
Block a user