Skip to content

Commit 59d7a4a

Browse files
committed
[fix] Skip uds on windows
1 parent c6e348f commit 59d7a4a

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

baked_in.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2596,7 +2596,12 @@ func isUnixAddrResolvable(fl FieldLevel) bool {
25962596

25972597
// isUnixDomainSocketExists is the validation function for validating if the field's value is an existing Unix domain socket.
25982598
// It handles both filesystem-based sockets and Linux abstract sockets.
2599+
// It always returns false for Windows.
25992600
func isUnixDomainSocketExists(fl FieldLevel) bool {
2601+
if runtime.GOOS == "windows" {
2602+
return false
2603+
}
2604+
26002605
sockpath := fl.Field().String()
26012606

26022607
if sockpath == "" {

validator_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2954,6 +2954,10 @@ func TestUnixAddrValidation(t *testing.T) {
29542954
}
29552955

29562956
func TestUnixDomainSocketExistsValidation(t *testing.T) {
2957+
if runtime.GOOS == "windows" {
2958+
t.Skip("Unix domain sockets are not supported on Windows")
2959+
}
2960+
29572961
validate := New()
29582962

29592963
errs := validate.Var("", "uds_exists")

0 commit comments

Comments
 (0)