Skip to content

refactor: move the internals of the root package to internal - #73

Merged
Insei merged 1 commit into
mainfrom
refactor/internal
Oct 19, 2026
Merged

Insei merged 1 commit into
mainfrom
refactor/internal

Conversation

@Insei

@Insei Insei commented Oct 19, 2026

Copy link
Copy Markdown
Owner

The root package keeps the API — validator.go, builder.go, options.go; the internals move to internal/zero (the allocation of the models), internal/helper (the errors with the translator and the locations) and internal/tags (the rules of the tags, Configurator.Tags calls it). No changes of the API or the behaviour, 100% coverage.

zero allocates the models of Configure, helper builds the errors with
the translator and the locations, tags configures the rules of the tags;
the root has the API: Validator, Configure, Configurator and options.
@github-actions

Copy link
Copy Markdown
Contributor

Benchmark diff: 28cb144 → 8312f93 (10 runs)

goos: linux
goarch: amd64
pkg: github.com/insei/valigo
cpu: Intel(R) Xeon(R) 6973P-C
           │  base.txt   │              head.txt              │
           │   sec/op    │   sec/op     vs base               │
Validate-4   92.23n ± 5%   89.07n ± 4%  -3.43% (p=0.023 n=10)

           │  base.txt  │            head.txt            │
           │    B/op    │    B/op     vs base            │
Validate-4   0.000 ± 0%   0.000 ± 0%  ~ (p=1.000 n=10) ¹
¹ all samples are equal

           │  base.txt  │            head.txt            │
           │ allocs/op  │ allocs/op   vs base            │
Validate-4   0.000 ± 0%   0.000 ± 0%  ~ (p=1.000 n=10) ¹
¹ all samples are equal

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (28cb144) to head (09e3cfe).

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #73   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           38        38           
  Lines         1471      1473    +2     
=========================================
+ Hits          1471      1473    +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Insei
Insei merged commit 8ea9ff6 into main Oct 19, 2026
6 checks passed
@Insei
Insei deleted the refactor/internal branch October 19, 2026 08:58
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.

2 participants