Open kke opened 5 months ago
sync.OnceValue
was introduced in go1.21, so there has to be two files with buildtags as validator supports older go versions.
coverage: 74.285% (-0.006%) from 74.291%
The coverage check does not seem to calculate correctly when files with build tags are involved.
Fixes Or Enhances
Replaces the local lazy initialization implementation with the stdlib
sync.OnceValue
.Using sync.OnceValue instead of the local implementation brings some benefits in allocations, panic handling and mutex usage after initialization.
sync.OnceValue
was introduced in go1.21 so backwards compatibility is provided vialazy_compat.go
and build tags.Make sure that you've checked the boxes below before you submit PR:
@go-playground/validator-maintainers