fix(deps): update module github.com/gookit/validate to v2#310
Open
renovate[bot] wants to merge 1 commit into
Open
fix(deps): update module github.com/gookit/validate to v2#310renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
Contributor
Author
|
renovate
Bot
force-pushed
the
renovate/github.com-gookit-validate-2.x
branch
from
July 12, 2026 09:38
7218a5a to
f39dbba
Compare
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:
v1.5.4→v2.0.1Release Notes
gookit/validate (github.com/gookit/validate)
v2.0.1Compare Source
Change Log
Refactor
d90d91c5a89ab1c69fc22d079b28aeab5ee7352c7f7fbd72164b2429Feature
bd9890380805f9854da39Update
db65592e0351f4503863d95431c1b60f8beOther
526044917dd47f63092bfc4088a08f63bfa59e87c01516f07v2.0.0Compare Source
v2.0 keeps breaking changes intentionally minimal (5 items). Core API,
validator names, tag semantics and the
DataFaceinterface are unchanged — mostprojects upgrade by bumping the import path to
/v2. Seedocs/UPGRADE-v2.md for the full migration guide.
Breaking Changes
github.com/gookit/validate→github.com/gookit/validate/v2(per Go Modules semantic import versioning). Update both
go getand allimportlines.go.mod).BetweensignatureBetween(val any, min, max int64)→Between(val, min, max any), now consistent withGt/LtviavalueCompare(supports int / uint / float / string). Semantic change for fractional bounds:
Between(2.9, 1, 2)wastrue(int64 truncation) and is nowfalse(no moretruncation). Tag/
StringRuleusage likebetween:1,2is unaffected.ValueLen(v)— use goutil'sreflects.Len(v)instead.validatetag.Previously a sub-struct field (struct /
*struct/ slice-of-struct /map-of-struct) was always descended into to collect its inner rules. Now
(
CheckSubOnParentMarkeddefaults to true) cascade only happens when theparent field has a
validatetag — the value may be empty (validate:""is enough to mark it); a named field with no
validatetag is nolonger descended into (Java
@Valid-style opt-in). Anonymous embeddedstructs (e.g.
type Bar struct { Foo }) are exempt — they are part ofthe parent and always cascade regardless of tag; only named sub-struct
fields require the tag. To restore the v1 "always cascade" behavior globally:
validate.Config(func(o *validate.GlobalOption){ o.CheckSubOnParentMarked = false }).See docs/UPGRADE-v2.md for migration details.
New Features
AddCustomType(fn CustomTypeFunc, types ...any)— register an underlyingvalue extractor for custom/wrapped types (e.g.
sql.NullString, money types).The extracted value flows through the existing validation paths (
required/numeric compare / length / string rules).
CustomTypeFunc func(field reflect.Value) any; returningnilis treated as empty. Mirrorsgo-playground/validator's
RegisterCustomTypeFunc.ResetCustomTypes()clearsthe registry. Zero overhead on the hot path when nothing is registered (atomic
gate short-circuit).
NewFactory()+Factory.Struct/Factory.Map+(*Validation).Release()— opt-in pooled factory that reuses
*Validationinstances across manysame-type validations, amortizing construction cost (allocs roughly halved in
reuse scenarios). Non-default:
Struct/Map/Newbehavior and lifecycleare unchanged.
Performance
Measured on Go 1.25 (count=6) against the v1.6.0 final:
Coverage 95.7% (v1.6.0 was 95.6%).
Internal
convertArgsType).validators.goby category (compare / string / type files).fieldValueintointernal/(reflectx,fieldval).v1.6.0Compare Source
Internal performance refactor. No public API changes — drop-in upgrade.
Performance
checks) in a concurrency-safe type cache; access struct fields via
FieldByIndexinstead ofFieldByName.ptr-to-struct / slice-of-struct / map-of-struct) and clone it per
validation, skipping the per-instance tag walk and rule parsing. Dynamic
types keep the original per-value path.
Translator; resolve with a custom→builtin fallback.required*,*Field, file checks)lazily on first use instead of eagerly per instance.
Measured (Go 1.25, count=6): static struct validation ~-78% time / -74%
allocations (10403→2295 ns/op, 132→34 allocs/op); map validation -65% /
-42%; slice-of-struct -37% / -20%. Behavior is byte-identical, guarded by a
rule-collection golden test.
Fixes
mutually-recursive struct types.
Val/Var: concurrent calls shared one validationinstance and raced on its error/validator maps; each call now uses a
pooled instance.
v1.5.7Compare Source
What's Changed
New Contributors
Full Changelog: gookit/validate@v1.5.6...v1.5.7
v1.5.6Compare Source
Change Log
Fixed
17116c7306d34374906afdc0ed0c89af7f9Feature
aff7898Other
a96441d3dc6a3f0abf62cWhat's Changed
New Contributors
Full Changelog: gookit/validate@v1.5.5...v1.5.6
v1.5.5Compare Source
Change Log
Feature
dd6d1368f43fe33d8c39a0393362Other
884461620ea74a8e7eaea133c91743de360New Contributors
Full Changelog: gookit/validate@v1.5.4...v1.5.5
Configuration
📅 Schedule: (UTC)
🚦 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.