Open ghost opened 2 years ago
its because of how Value
method is implemented.
it return []byte from json.Unmarshal. which is obviously would be longger than 3 or shorter than 1
the solution would be to have separate type for request validation and dto.
solution: use is
package as mentioned in the credit. asaskevich/govalidator does not check for sql valuer.
if I set a type alias of basic type,like
[]string
,then, I neet to add two function,such as ( value and scan ,mysql json need this), the bug is appened. the entire code under:Something strange is coming in function value !!! If
p
without pointer can't pass validate!But, if add pointer, it pass!