Documentation ¶ Index ¶ func ValidateStudent(student *Student) error type Student Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func ValidateStudent ¶ func ValidateStudent(student *Student) error Types ¶ type Student ¶ type Student struct { gorm.Model // This inserts ID, CreatedAt, UpdatedAt, DeletedAt Name string `json:"name" validate:"nonzero"` Age int `json:"age" validate:"min=1,max=100"` Document string `json:"document" validate:"len=11,regexp=^[0-9]*$"` } Source Files ¶ View all Source files student.go Click to show internal directories. Click to hide internal directories.