go-playground / validator

:100:Go Struct and Field validation, including Cross Field, Cross Struct, Map, Slice and Array diving
MIT License
16.64k stars 1.32k forks source link

dirpath fails on non-existing directory #1212

Open dirkm opened 8 months ago

dirkm commented 8 months ago

Package version eg. v10:

Issue, Question or Enhancement:

The way I read the documentation the tag dirpath should pass for non-existing directories. This currently returns the error:

 Field validation for '...' failed on the 'dirpath'

I expect:

dir: existing directories dirpath: strings that could be a directory.

Code sample, to showcase or reproduce:

zemzale commented 8 months ago

Without a repro it's impossible to say what is wrong here, and our tests are not failing and working, If you can provide a repro then I can look into it

dirkm commented 8 months ago

sure, give me a few days. I am quite busy right now.

Thanks for your attention

jozefcipa commented 4 months ago

I'm having the same issue, dirpath indeed fails when a directory gets deleted.

dirkm commented 4 months ago

somehow I forgot the demo-program. Below is my attempt. It currently fails, and should fail on most unixes.

go run github.com/dirkm/demovalidator@latest