You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not entirely sure about the original design intention for this validator. It might have been intended to validate input values exclusively for the 'Unix' network. However, it would be beneficial to extend its functionality to also handle unixgram and unixpacket networks.
We always welcome pull requests with improvements or fixes.
I suggest creating a new socket validator and implementing it with the approach you provided.
Package version eg. v9, v10:
v10.23.0
Issue, Question or Enhancement:
The unix_addr check is useless. I looked into the src:
https://github.com/go-playground/validator/blob/6c3307e6c64040ebc0efffe9366927c68146ffba/baked_in.go#L2564C16-L2564C31
and in stdlib net:
https://cs.opensource.google/go/go/+/refs/tags/go1.23.4:src/net/unixsock.go;l=57
effectivly this will never throw an error since you're always passing "unix".
If fact, ResolveUnixAddr is itself useless to check if the socket actually exists.
You need something that checks if the file exists and if that file is a socket:
The text was updated successfully, but these errors were encountered: