Adds .gitea/workflows/ci.yml: on push to main and on pull requests, run
`go vet ./...` then `go test ./...` in a golang:1.21-alpine container.
Also removes .github/workflows/test.yml, which only triggered on a
`develop` branch that no longer exists and depended on an external
Discord notification action and an unset DISCORD_WEBHOOK secret.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Replace the RFC 5322 mega-regexp with net/mail.ParseAddress, which is the
standard library's address parser and far easier to audit. A bare address
is required: inputs with a display name, angle brackets, a comment, or
trailing content are rejected, as is an address list.
Behaviour change: ParseAddress does not require the domain to contain a
dot, so "alice@localhost" now validates. Layer Match or a DNS lookup on
top if a stricter domain is needed.
Also rewrites FuzzEmail, which previously asserted that *every* input is
invalid, into checks that Email never returns an unexpected error type,
never panics, and gives a stable verdict.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Broadens the built-in set with the string/presence checks that came up
most often when reaching for this package:
- Required[T comparable] non-zero value
- Prefix / Suffix / Contains strings.HasPrefix/HasSuffix/Contains
- Match(*regexp.Regexp) arbitrary pattern
All follow the existing shape: a constructor returning func(T) error, a
sentinel error matched with errors.Is, table-driven tests and an Example.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Collect is the all-errors-at-once counterpart to All. All still stops at
the first failure (unchanged); Collect runs every function and returns the
failures joined with errors.Join, which errors.Is still matches element by
element. Kept as a separate function rather than a flag on All so All's
signature and behaviour don't change.
Closes#5
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>