go-ozzo / ozzo-validation

An idiomatic Go (golang) validation package. Supports configurable and extensible validation rules (validators) using normal language constructs instead of error-prone struct tags.
MIT License
3.76k stars 223 forks source link

Endless loop #191

Closed pdxrlj closed 7 months ago

pdxrlj commented 9 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())),
    )
}
PhakornKiong commented 8 months ago

@pdxrlj Probably related to https://github.com/go-ozzo/ozzo-validation/issues/133#issuecomment-724425755