• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

gookit / validate / 26208967737
96%
master: 96%

Build:
Build:
LAST BUILD BRANCH: fix/required-if-pointer-334
DEFAULT BRANCH: master
Ran 21 May 2026 10:19AM UTC
Jobs 7
Files 14
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

21 May 2026 06:14AM UTC coverage: 95.604% (-0.1%) from 95.701%
26208967737

Pull #335

github

SAY-5
fix(validators): handle pointer fields in RequiredIf

RequiredIf silently skipped its check whenever either side of the rule
was a pointer:

  - When the destination field is a pointer (e.g. *bool), reflect.ValueOf
    returns a value of Kind Pointer. convTypeByBaseKind has no
    string-to-Pointer conversion, so dstVal == wantVal was never
    evaluated and the function fell through to default-True / skip.

  - When the source field is a pointer to a zero value (e.g.
    *string("")), val != nil && !IsEmpty(val) was true, so the
    rule's 'must be present and not empty' contract was not enforced.

Unwrap pointers on both sides: treat a nil pointer as the field being
absent (rule does not trigger, dependent field remains optional), and
treat a pointer to a zero value as the zero value itself for the
not-empty check. Adds five subtests covering each pointer scenario;
two of them fail on the old code and pass on the new code.

Closes #334
Pull Request #335: fix(validators): handle pointer fields in RequiredIf (#334)

22 of 26 new or added lines in 1 file covered. (84.62%)

3001 of 3139 relevant lines covered (95.6%)

7.74 hits per line

Uncovered Changes

Lines Coverage ∆ File
4
98.38
-0.56% validators.go
Jobs
ID Job ID Ran Files Coverage
1 Go-1.22 - 26208967737.1 21 May 2026 10:19AM UTC 14
95.6
GitHub Action Run
2 Go-1.19 - 26208967737.2 21 May 2026 10:19AM UTC 14
95.6
GitHub Action Run
3 Go-stable - 26208967737.3 21 May 2026 10:19AM UTC 14
95.6
GitHub Action Run
4 Go-1.25 - 26208967737.4 21 May 2026 10:19AM UTC 14
95.6
GitHub Action Run
5 Go-1.21 - 26208967737.5 21 May 2026 10:19AM UTC 14
95.6
GitHub Action Run
6 Go-1.24 - 26208967737.6 21 May 2026 10:19AM UTC 14
95.6
GitHub Action Run
7 Go-1.23 - 26208967737.7 21 May 2026 10:19AM UTC 14
95.6
GitHub Action Run
Source Files on build 26208967737
  • Tree
  • List 14
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #335
  • PR Base - master (#25354608639)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc