Repository navigation
Update module github.com/go-ozzo/ozzo-validation/v4 to v4.5.0 - #155
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
renovate
Bot
deleted the
renovate/github.com-go-ozzo-ozzo-validation-v4-4.x
branch
August 23, 2026 14:30
renovate
Bot
force-pushed
the
renovate/github.com-go-ozzo-ozzo-validation-v4-4.x
branch
2 times, most recently
from
August 28, 2026 08:43
37dc820 to
c07ad57
Compare
renovate
Bot
force-pushed
the
renovate/github.com-go-ozzo-ozzo-validation-v4-4.x
branch
2 times, most recently
from
August 31, 2026 14:00
c07ad57 to
769271f
Compare
renovate
Bot
force-pushed
the
renovate/github.com-go-ozzo-ozzo-validation-v4-4.x
branch
from
October 27, 2026 19:40
769271f to
7352a3a
Compare
Contributor
Author
ℹ️ Artifact update noticeFile name: go.modIn order to perform the update(s) described in the table above, Renovate ran the
Details:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
v4.3.0→v4.5.0Release Notes
go-ozzo/ozzo-validation (github.com/go-ozzo/ozzo-validation/v4)
v4.5.0: — v4.3.0 empty-value semantics restored, errors.Is and Flatten, no-template buildCompare Source
This release restores the v4.3.0 behavior that v4.4.0 changed for empty values. It adds explicit opt-ins for the
cases v4.4.0 was meant to fix, and fixes the problems found in the unreleased changes before they ship.
Fixed
Restore the v4.3.0 empty-value semantics (#234, reported
by @ldez). Two "Breaking Changes" of v4.4.0 are reverted:
time.Timeis. This applies to every rule that checks forempty values.
RequiredandNilOrNotEmptypass again for a zero struct, andRequiredon a zeroValidatablestruct reports the struct's own field errors instead of "cannot be blank".Emptyreports a zerostruct as not empty again, and the rules that skip empty values (
In,NotIn,Length,RuneLength,Dateand the string rules, including
is.*) validate a zero struct again.Each(Required)passes again forzero-struct elements;
Min()/Max()skip empty values again (0, 0.0, the zerotime.Time), as their documentation says.To keep the v4.4 checks, use the new opt-ins below.
Errors.Error()no longer starts with"; "when the first sorted key holds a nil error. AnErrorswith onlynil entries returns
"", as an emptyErrorsdoes.is.Latitude/is.Longitudearevalidation.StringRuleagain, as in v4.4.1, so code that holds them as aStringRule compiles. String input is validated exactly as in v4.4.1:
"NaN","1e1","0x1p-2","45."and".5"are rejected. Numbers are accepted as introduced by#223; NaN and infinities are rejected.
A missing map key never runs its rules with a nil value: rules written for the key's type, such as a
Bywith atype assertion, no longer panic. The error stays "required key is missing" (
validation_key_missing). Only aRequiredorNotNilrule with a custom message (Error/ErrorObject) reports its own error(#222 by
@nguyenvantuan2391996, narrowed) — fixes
#134.
EnsureString(nil)returns an error instead of panicking(#232 by @yuefdev) — fixes
#233.
MultipleOf(0)returns an error instead of panicking with a division by zero(#231 by @SashaMIT);
MultipleOf(nil)returns an error instead of panicking.NotIn()compares withreflect.DeepEqual, asIn()does: it no longer panics on uncomparable values such as[]byte, and structs with pointer fields compare by the pointed-to values(#229 by @youdie006).
Added
ozzo_validation_no_templatebuild tag: error messages are rendered withouttext/template, which removes itfrom the binary and makes it noticeably smaller. Built-in messages read the same; custom messages support only
field placeholders such as
{{.min}}and{{ .min }}. See the README(#235 by @ldez) — fixes
#230.
ThresholdRule.ValidateEmpty():Min/Maxalso check empty values, e.g.Min(0).Exclusive().ValidateEmpty()rejects 0 (#165,
#180).
EmptyCheckerinterface: a struct type defines when its value is empty(#143).
StringRule.AllowNumber(): a string rule can also accept finite numbers.is.Latitude/is.Longitudeaccept numbers (int, uint and float types)(#223 by
@nguyenvantuan2391996) — fixes
#185.
DateRule.Location(): parse dates that carry no time zone in a given location; the default stays UTC(#220 by
@nguyenvantuan2391996) — fixes
#166.
Errors.Is:errors.Isfinds a matching error anywhere invalidation.Errors, including nested maps, slices andstructs (#225 by
@ChrisJr404) — fixes #116.
#225 also proposed
Errors.As. It is not part of this release. With it,errors.As(err, &validation.Error)returned the first field's error for a map of field errors, and code that uses that call to tell a single error from
a field map lost the field names.
errors.Askeeps reportingfalseforvalidation.Errors; useerrors.IsorFlatten()to reach the individual errors.ErrorObject.Is: a validation error matches a built-in error with the same code, soerrors.Is(err, validation.ErrRequired)works, also for rules with a custom message such asRequired.Error("..."). Give the sentinel errors of your own rules a code: an error with an empty code nevermatches.
Flatten(err),Errors.Flatten()andFieldError: a flat, sorted list of all field errors with the key path,code, rendered message and params, and the error itself in
Err.Field()givesitems.0.name,Pointer()givesthe RFC 6901 pointer
/items/0/name. Slice indexes sort numerically (items.2beforeitems.10). A single errorthat is not an
Errorsis one entry with no path. CheckErrfor anInternalErrorbefore sendingMessageto aclient.
errors.Isanderrors.Asreach the error wrapped byNewInternalError.README: "Empty Values", "Checking for an Error", "Listing Field Errors" and "Smaller Binaries" sections.
Changed
go 1.21in go.mod), the minimum announced in#207.
is.CurrencyCodeuses an ISO 4217 list maintained in this module instead of govalidator's, which adds currentcodes such as VES and VED (#224 by
@nguyenvantuan2391996) — fixes
#206.
without the
ozzo_validation_no_templatetag. It also builds and tests on 386, checks formatting andgo mod tidy, and pins every tool version except govulncheck, which stays on the latest release by design so thatthe vulnerability data is current. One required check, "Test", gates all jobs.
(#228 by @dw-kihara);
updated in this release for the restored semantics.
@nguyenvantuan2391996).
coverage.outis removed; test outputs are ignored.Install
Full changelog: go-ozzo/ozzo-validation@v4.4.1...v4.5.0
v4.4.1: — Performance: 36% fewer allocationsCompare Source
Performance
Struct field offset cache eliminates repeated
reflect.StructFieldallocations.Also fixes benchmark to pre-compile regex (was inflating alloc count).
Full Changelog: go-ozzo/ozzo-validation@v4.4.0...v4.4.1
v4.4.0: — Revival ReleaseCompare Source
Revival release — ozzo-validation is actively maintained again after 6 years.
12 community PRs merged, maintainer bug fixes, modernized CI infrastructure.
Added
is.UUIDv7validation rule per RFC 9562 (#205 by @dmitryzhvinklis)is.ULIDvalidation rule (#171 by @upamune)is.Originvalidation rule for CORS origins (#198 by @nguyenvantuan2391996)OptionalKey()andDynamicMap()convenience constructors (#151 by @Jessinra)EachUntilFirstError()rule for large collections (#93 by @geekflyer)Fixed
+prefix per ITU-T standard (#208 by @Yanhu007)Each()now passes pointers correctly toBy()callbacks (#160 by @dane)IsEmpty()treats all zero-valued structs as empty (#144 by @soranoba)Errors.Error()no longer panics on nil values (#212)Min()/Max()now validate zero values instead of silently skipping them (#212)Breaking Changes
These are bug fixes — the old behavior was incorrect:
is.E164rejects phone numbers without+prefix (spec-correct)Each()withBy()on pointer slices passes*Tinstead ofTIsEmpty()returnstruefor zero-valued structs (was onlytime.Time{})Min()/Max()validate numeric zero andtime.Time{}(were silently skipped)Thank You
Thanks to all contributors who waited patiently — some PRs were open for 5+ years.
Special thanks to @qiangxue for entrusting the project to new maintainers.
Configuration
📅 Schedule: (in timezone Asia/Tokyo)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.