Repository navigation
Releases
v0.2.0
Validate exact decimal amounts and choose accepted currencies with readable fluent chains. v0.2.0 adds decimal validation, package-defined currency identifiers, and clearer examples throughout the README.
What's new
- Exact decimal bounds and equality, including values beyond floating-point precision. Accepts json.Number and defined string types without rounding or rewriting the submitted value.
- MaxScale limits written fractional digits, including trailing zeros.
- Fluent currency allowlists such as .USD().EUR().GBP(), backed by 178 package-defined ISO identifiers. Selectors form one allowlist with OR semantics.
- Focused, spaced examples and a complete currency selector list in the README.
Try it
go get github.com/goforj/validation@v0.2.0For an already decoded request:
err := validation.Validate(
validation.Decimal("amount", request.Amount).
Required().
Min("0.01").
MaxScale(2),
validation.Currency("currency", request.Currency).
Required().
USD().
EUR(),
)See the examples, complete selector list, and contracts.
Upgrading
Existing APIs and the Go 1.24 minimum are unchanged. The runtime still has no external dependencies. Currency selectors define accepted identifiers; precision policy, conversion, arithmetic, and rounding remain application-owned.
Only the root module is published. The release review records exact coverage, fuzzing, resource checks, and public-consumer verification.
v0.1.0
Validate Go values with readable fluent chains, reusable typed rules, and useful field errors. v0.1.0 is the first release of GoForj Validation.
What ships
- Typed builders for strings, numbers, booleans, time, slices, maps, and domain values.
- Direct format checks such as
IsEmail()andIsUUIDv7(), plus dates, network values, encodings, and character classes. - Optional and presence-aware inputs that distinguish omitted fields, explicit null, and supplied zero values.
- Pluggable validator types and functions,
Any/All/Notcomposition, and context-aware checks. - Ordered field errors with stable codes, custom messages, localization hooks, and configurable error collection.
Try it
Requires Go 1.24 or newer, with no runtime dependencies.
go get github.com/goforj/validation@v0.1.0err := validation.Validate(
validation.String("name", "Ada").Required().Min(2),
validation.String("email", "ada@example.com").IsEmail(),
validation.Number("age", 36).Min(18),
)See the quick start and runnable examples and validation contracts.
This release publishes only github.com/goforj/validation; the docs module remains repository tooling. The release review records correctness fixes, exact statement coverage, fuzzing, resource checks, and minimum Go verification.