go-playground / validator

:100:Go Struct and Field validation, including Cross Field, Cross Struct, Map, Slice and Array diving
MIT License
16.14k stars 1.29k forks source link

performance: min, max validators have to constantly parse param #1164

Open sschepens opened 10 months ago

sschepens commented 10 months ago

Package version eg. v9, v10:

v10

Issue, Question or Enhancement:

Currently, min, max and probably other tags are required to constantly parse the tag param strconv.ParseInt(param, 0, 64).

This incurrs a considerable cost and seems unnecessary since tag params do not change over time.

Isn't there a way to cache this value on tag parsing?