go-playground / validator

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

The error message for a `validate.Var()` contains no information about key and fields #1109

Closed HaraldNordgren closed 3 weeks ago

HaraldNordgren commented 1 year ago

Package version eg. v9, v10:

v10

Issue, Question or Enhancement:

The error message for a err = validate.Var(val, constraint) contains no information about key and fields:

Key: '' Error:Field validation for '' failed on the 'gt' tag

Code sample, to showcase or reproduce:

err = validate.Var(val, constraint)
deankarn commented 1 year ago

This is not an issue and has been asked before.

There is no way to dynamically get this information and why it is not present.