Implement validation for Book
Closed this issue · 0 comments
GregoryAlbouy commented
Description
Tasks
Suggestions
- For easy validation you can use ozzo-validation
- Usage example on another project:
func (u User) Validate() error { return validation.ValidateStruct(&u, validation.Field(&u.Email, is.EmailFormat), validation.Field(&u.Password, validation.Required, validation.Length(8, 50)), validation.Field(&u.Username, validation.Required, is.Alphanumeric, validation.Length(3, 20)), ) }
Notes
Estimated time
2h