Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed filepath tag when used * in path #1388

Closed

Conversation

DevKhaverko
Copy link

@DevKhaverko DevKhaverko commented Feb 25, 2025

Fixes Or Enhances

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

  • Tests exist or have been written that cover this particular change.

@go-playground/validator-maintainers

@DevKhaverko DevKhaverko requested a review from a team as a code owner February 25, 2025 03:49
@coveralls
Copy link

Coverage Status

coverage: 75.278% (-0.01%) from 75.291%
when pulling cdcadbe on DevKhaverko:FIX_FILEPATH_TAG
into 378f26e on go-playground:master.

@zemzale
Copy link
Member

zemzale commented Feb 25, 2025

Thanks for the PR, but please create an issue next time. It's impossible to understand what is the issue here.

There are few things:

  1. having a * in a filepath is not invalid
  2. syscall.ENOENT would indicate that the file doesn't exist, but the validator you are "fixing" doesn't support that:

File Path
This validates that a string value contains a valid file path but does not validate the existence of that file. This is done using os.Stat, which is a platform independent function.

  1. Missing test case to support and help understand what kind of bug there even is

if you wish to check if a file exists you should use file validator.

Please open an issue if you think there is an actual bug here, but without it, I will close this PR since there is not enough information.

P.S. Found the issue you created, but it should be linked in the PR

@zemzale zemzale closed this Feb 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants