package illust import validation "github.com/go-ozzo/ozzo-validation" type IllustValidator struct { } func (iv *IllustValidator) Validate(i interface{}) error { if c, ok := i.(validation.Validatable); ok { return c.Validate() } return nil } func (i Illust) Validate() error { return validation.ValidateStruct( &i, validation.Field(&i.Id, validation.Required), validation.Field(&i.Name, validation.Required), validation.Field(&i.Sha256, validation.Required), validation.Field(&i.S3Id, validation.Required), validation.Field(&i.Tags, validation.Required), validation.Field(&i.Originals, validation.Required), validation.Field(&i.Characters, validation.Required), validation.Field(&i.Description, validation.Required), ) }