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.73k stars 224 forks source link

validation.When() function missing? #125

Closed jeffmvr closed 4 years ago

jeffmvr commented 4 years ago

Hi,

First, thanks for the great library.

Has this library changed to remove the validation.When() function, or is there a new way to do conditional validation? This seems to no longer be present in the latest code yet is still documented as existing in the README.

qiangxue commented 4 years ago

It's here: https://github.com/go-ozzo/ozzo-validation/blob/master/when.go#L4

jeffmvr commented 4 years ago

Thanks.

My issues was running

go get github.com/go-ozzo/ozzo-validation

resulted in a 3.X version to be downloaded which did not have this function. Runnning

go get github.com/go-ozzo/ozzo-validation/v4

fixed my issue

qiangxue commented 4 years ago

I can't reproduce the "go get" issue... Anyway, glad to hear that you have solved the problem and the library is useful to you!