I am using Validator package. I have the next Struct:
type User struct {
Name string `validate:"required"`
Email string `validate:"required,email"`
CreditCard string `validate:"credit_card"`
Password string `validate:"min=8,max=255"`
}
What can I do to generate valid random values for thats fields?
>Solution :
You can use faker package. It has functions like FirstName(), Email(), CCNumber(). You can also use tags (one, two) with this package in your struct.