Closed rookiefront closed 4 years ago
package main import ( "fmt" "github.com/asaskevich/govalidator" ) type T struct { Title string `json:"title" valid:"required"` Content string `json:"content" ` Text string `json:"text" valid:"required"` } func main() { _f := T{ Title: "", Content: "", Text: "", } _, err := govalidator.ValidateStruct(_f) fmt.Println(err) // IS nil }
How to verify that the string is empty? Use length to judge?
I'm having the same problem. What was the solution for this? @codexuexi
Might be related to: https://github.com/asaskevich/govalidator/issues/359
How to verify that the string is empty? Use length to judge?