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

gookit / validate
96%

Build:
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 master
branch: master
CHANGE BRANCH
x
Reset
  • master
  • 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
  • fix/required-if-pointer-334
  • 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 12:36PM UTC coverage: 95.604% (-0.1%) from 95.701%
26226312343

push

github

web-flow
fix(validators): handle pointer fields in RequiredIf (#334) (#335)

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

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

3001 of 3139 relevant lines covered (95.6%)

6.63 hits per line

Relevant lines Covered
Build:
Build:
3139 RELEVANT LINES 3001 COVERED LINES
6.63 HITS PER LINE
Source Files on master
  • 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
26226312343 master fix(validators): handle pointer fields in RequiredIf (#334) (#335) 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 valu... push 21 May 2026 12:36PM UTC web-flow github
95.6
25354608639 master build(deps): bump github.com/gookit/goutil from 0.7.4 to 0.7.5 (#333) push 05 May 2026 02:28AM UTC web-flow github
95.7
24452784863 master build(deps): bump softprops/action-gh-release from 2 to 3 (#332) push 15 Apr 2026 11:48AM UTC web-flow github
95.7
23521322770 master Fix ValidatePrivateFields: UpperFirst corrupts unexported embedded struct field paths (#331) * Initial plan * Fix ValidatePrivateFields: UpperFirst breaks private embedded struct field lookup Co-authored-by: inhere <5302062+inhere@users.noreply... push 25 Mar 2026 02:02AM UTC web-flow github
95.7
23126780206 master lint: Optimize code style and update test configuration style: 使用fmt.Fprint代替buf.WriteString+fmt.Sprint refactor: 使用http.Method常量代替字符串 test: 更新CI工作流配置,添加stable版本测试 style: 清理未使用的参数命名 fix: 修正测试用例中的字段引用 push 16 Mar 2026 03:33AM UTC inhere github
95.69
23032663550 master build(deps): bump github.com/gookit/goutil from 0.7.3 to 0.7.4 (#330) push 13 Mar 2026 01:54AM UTC web-flow github
95.69
22559630393 master lint: Upgrade golangci-lint config to v2 push 02 Mar 2026 03:03AM UTC inhere github
95.69
22544367285 master fix: improve wildcard path validation for map data - Add getParentSliceLen() to get parent slice length before the last .* - Compare parent slice length with returned values to detect missing fields - Handle different GetByPath return types ([]ma... push 01 Mar 2026 01:26PM UTC inhere github
95.69
19557503821 master build(deps): bump actions/checkout from 5 to 6 (#322) Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blo... push 21 Nov 2025 02:04AM UTC web-flow github
96.01
19332857401 master fix: 内嵌类型为指针类型时,内嵌结构体字段的default无效 (#319) push 13 Nov 2025 01:17PM UTC web-flow github
96.01
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