Skip to content

fix: resolve eqField validation for pointer types in the validator#310

Merged
inhere merged 1 commit intogookit:masterfrom
almas-x:fix-272
Sep 3, 2025
Merged

fix: resolve eqField validation for pointer types in the validator#310
inhere merged 1 commit intogookit:masterfrom
almas-x:fix-272

Conversation

@almas-x
Copy link
Contributor

@almas-x almas-x commented Sep 3, 2025

close #272

This PR resolves an issue where the eqField validation rule did not properly handle pointer types in structs. Previously, when comparing fields like FieldA *string and FieldB *string using eqField:FieldA, the validator would fail to correctly assess equality if both fields were pointers.

With this fix, eqField now correctly dereferences pointer values and compares their actual contents, ensuring accurate validation for pointer fields.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 17421918091

Details

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 96.936%

Totals Coverage Status
Change from base Build 17420715039: 0.0%
Covered Lines: 2942
Relevant Lines: 3035

💛 - Coveralls

@inhere inhere merged commit dc0ed0c into gookit:master Sep 3, 2025
17 of 18 checks passed
@almas-x almas-x deleted the fix-272 branch September 3, 2025 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

eqField对于指针类型数据无法正确校验

3 participants