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

gookit / validate
96%
master: 96%

Build:
Build:
LAST BUILD BRANCH: fix/required-if-pointer-334
DEFAULT BRANCH: master
Repo Added 23 Aug 2018 06:40AM UTC
Files 14
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

LAST BUILD ON BRANCH fix/required-if-pointer-334
branch: fix/required-if-pointer-334
CHANGE BRANCH
x
Reset
  • fix/required-if-pointer-334
  • 1.1.x
  • almas-297
  • copilot/fix-validate-private-fields-issue
  • dependabot/add-v2-config-file
  • dependabot/github_actions/WillAbides/setup-go-faster-1.10.0
  • dependabot/github_actions/WillAbides/setup-go-faster-1.10.1
  • dependabot/github_actions/WillAbides/setup-go-faster-1.11.0
  • dependabot/github_actions/WillAbides/setup-go-faster-1.12.0
  • dependabot/github_actions/WillAbides/setup-go-faster-1.13.0
  • dependabot/github_actions/WillAbides/setup-go-faster-1.14.0
  • dependabot/github_actions/WillAbides/setup-go-faster-1.8.0
  • dependabot/github_actions/WillAbides/setup-go-faster-1.9.0
  • dependabot/github_actions/WillAbides/setup-go-faster-1.9.1
  • dependabot/github_actions/actions/checkout-3
  • dependabot/github_actions/actions/checkout-4
  • dependabot/github_actions/actions/checkout-5
  • dependabot/github_actions/actions/checkout-6
  • dependabot/github_actions/github/codeql-action-3
  • dependabot/github_actions/github/codeql-action-4
  • dependabot/github_actions/golangci/golangci-lint-action-4
  • dependabot/github_actions/golangci/golangci-lint-action-5
  • dependabot/github_actions/golangci/golangci-lint-action-6
  • dependabot/github_actions/golangci/golangci-lint-action-7
  • dependabot/github_actions/golangci/golangci-lint-action-8
  • dependabot/github_actions/golangci/golangci-lint-action-9
  • dependabot/github_actions/softprops/action-gh-release-2
  • dependabot/github_actions/softprops/action-gh-release-3
  • dependabot/go_modules/github.com/gookit/filter-1.1.1
  • dependabot/go_modules/github.com/gookit/filter-1.1.3
  • dependabot/go_modules/github.com/gookit/filter-1.2.2
  • dependabot/go_modules/github.com/gookit/filter-1.2.3
  • dependabot/go_modules/github.com/gookit/goutil-0.3.1
  • dependabot/go_modules/github.com/gookit/goutil-0.3.10
  • dependabot/go_modules/github.com/gookit/goutil-0.3.12
  • dependabot/go_modules/github.com/gookit/goutil-0.3.13
  • dependabot/go_modules/github.com/gookit/goutil-0.3.14
  • dependabot/go_modules/github.com/gookit/goutil-0.3.2
  • dependabot/go_modules/github.com/gookit/goutil-0.3.5
  • dependabot/go_modules/github.com/gookit/goutil-0.3.6
  • dependabot/go_modules/github.com/gookit/goutil-0.3.7
  • dependabot/go_modules/github.com/gookit/goutil-0.3.8
  • dependabot/go_modules/github.com/gookit/goutil-0.3.9
  • dependabot/go_modules/github.com/gookit/goutil-0.4.0
  • dependabot/go_modules/github.com/gookit/goutil-0.4.1
  • dependabot/go_modules/github.com/gookit/goutil-0.4.2
  • dependabot/go_modules/github.com/gookit/goutil-0.4.4
  • dependabot/go_modules/github.com/gookit/goutil-0.4.5
  • dependabot/go_modules/github.com/gookit/goutil-0.4.6
  • dependabot/go_modules/github.com/gookit/goutil-0.5.0
  • dependabot/go_modules/github.com/gookit/goutil-0.5.1
  • dependabot/go_modules/github.com/gookit/goutil-0.5.15
  • dependabot/go_modules/github.com/gookit/goutil-0.5.2
  • dependabot/go_modules/github.com/gookit/goutil-0.5.4
  • dependabot/go_modules/github.com/gookit/goutil-0.5.5
  • dependabot/go_modules/github.com/gookit/goutil-0.5.6
  • dependabot/go_modules/github.com/gookit/goutil-0.5.7
  • dependabot/go_modules/github.com/gookit/goutil-0.5.8
  • dependabot/go_modules/github.com/gookit/goutil-0.5.9
  • dependabot/go_modules/github.com/gookit/goutil-0.6.10
  • dependabot/go_modules/github.com/gookit/goutil-0.6.13
  • dependabot/go_modules/github.com/gookit/goutil-0.6.14
  • dependabot/go_modules/github.com/gookit/goutil-0.6.18
  • dependabot/go_modules/github.com/gookit/goutil-0.6.9
  • dependabot/go_modules/github.com/gookit/goutil-0.7.0
  • dependabot/go_modules/github.com/gookit/goutil-0.7.1
  • dependabot/go_modules/github.com/gookit/goutil-0.7.4
  • dependabot/go_modules/github.com/gookit/goutil-0.7.5
  • dependabot/go_modules/github.com/stretchr/testify-1.6.1
  • dependabot/go_modules/github.com/stretchr/testify-1.7.0
  • dependabot/go_modules/github.com/stretchr/testify-1.7.1
  • dependabot/go_modules/github.com/stretchr/testify-1.7.2
  • dependabot/go_modules/github.com/stretchr/testify-1.7.3
  • dependabot/go_modules/github.com/stretchr/testify-1.7.4
  • dependabot/go_modules/github.com/stretchr/testify-1.7.5
  • dependabot/go_modules/github.com/stretchr/testify-1.8.0
  • dependabot/go_modules/github.com/stretchr/testify-1.8.1
  • dependabot/go_modules/github.com/stretchr/testify-1.8.2
  • dependabot/go_modules/github.com/stretchr/testify-1.8.3
  • dependabot/go_modules/github.com/stretchr/testify-1.8.4
  • dev-tpy
  • fix-272
  • fix-284
  • fix-301
  • fix-302
  • master
  • refs/tags/v1.2.10
  • refs/tags/v1.2.11
  • refs/tags/v1.2.3
  • refs/tags/v1.2.4
  • refs/tags/v1.2.5
  • refs/tags/v1.2.6
  • refs/tags/v1.2.7
  • refs/tags/v1.2.8
  • refs/tags/v1.2.9
  • refs/tags/v1.3.0
  • refs/tags/v1.3.1
  • refs/tags/v1.3.2
  • refs/tags/v1.4.0
  • refs/tags/v1.4.1
  • refs/tags/v1.4.2
  • refs/tags/v1.4.3
  • refs/tags/v1.4.4
  • refs/tags/v1.4.5
  • refs/tags/v1.4.6
  • refs/tags/v1.5.0
  • refs/tags/v1.5.1
  • refs/tags/v1.5.2
  • refs/tags/v1.5.3
  • refs/tags/v1.5.4
  • refs/tags/v1.5.5
  • refs/tags/v1.5.6
  • refs/tags/v1.5.7
  • v1.0.0
  • v1.0.1
  • v1.0.2
  • v1.0.3
  • v1.1.0
  • v1.1.1
  • v1.1.2
  • v1.1.3
  • v1.1.4
  • v1.2.0
  • v1.2.1
  • v1.2.2
  • v1.2.3
  • v1.2.4
  • v1.2.5

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

Relevant lines Covered
Build:
Build:
3139 RELEVANT LINES 3001 COVERED LINES
7.74 HITS PER LINE
Source Files on fix/required-if-pointer-334
  • Tree
  • List 14
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
26208967737 fix/required-if-pointer-334 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 Poin... Pull #335 21 May 2026 10:19AM UTC SAY-5 github
95.6
See All Builds (589)
  • Repo on GitHub
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