:100:Go Struct and Field validation, including Cross Field, Cross Struct, Map, Slice and Array diving
16.14k
stars
1.29k
forks
source link
Using required_with tag for a slice field, but need it's length greater than 0 if it is not nil, how write tag? #1151
Open
dablelv opened 10 months ago
Below is my request struct.
I want the DroneSns length greater than 0 when it is not nil. How to write the tag?
I found write like below but doesn't work, because it must require the DroneSns isn't nil while DroneSns can be nil.
Any one can help me, thanks in advance.