go-playground / validator

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

Fix filepath validator panic if the value is an existing dir #1133

Closed nodivbyzero closed 1 year ago

nodivbyzero commented 1 year ago

Fixes Or Enhances

This PR adds an additional check for directories in the isFilePath() function.

Connected to #1102

Make sure that you've checked the boxes below before you submit PR:

@go-playground/validator-maintainers

coveralls commented 1 year ago

Coverage Status

coverage: 73.962% (-0.01%) from 73.972% when pulling dcd21e81522381cfdf49e911f5fe8c398a9f551e on nodivbyzero:validator-file-path-fix-is-dir into bd1113d5c1901c5205fc0a7af031a11268ff13ee on go-playground:master.