Closed pdxrlj closed 7 months ago
func (c *Collection) Validate() error { return validation.Validate(&c.Name, validation.By(func(value interface{}) error { collection := value.(*Collection) fmt.Printf("===================\n") return nil }), //validation.Field(&c.Column.Drop, validation.When(len(c.Column.Drop) > 0, validation.Each(validation.Required))), //validation.Field(&c.Column.Rename, validation.When(len(c.Column.Rename) > 0, validation.Each(validation.Required))), //validation.Field(&c.Column.Modify, validation.When(len(c.Column.Modify) > 0), ColumnModifyRule()), //validation.Field(&c.Column.Index, validation.When(len(c.Column.Index.Drop) > 0, validation.Each(validation.Required))), //validation.Field(&c.Column.Partition, validation.When(len(c.Column.Partition.Add) > 0, ColumnPartitionRule())), ) }
@pdxrlj Probably related to https://github.com/go-ozzo/ozzo-validation/issues/133#issuecomment-724425755