PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: go-playground/validator (go)

Issue:
Exclude If doesn't work on boolean and nil parametr
- [x] I have looked at the documentation [here](https://pkg.go.dev/github.com/go-playground/validator/v10#section-documentation) first? Yes
- [x] I have looked at the examples provided that may showcase my question [here](/_examples)? Yes in doc.go too 

### Package version eg. v9, v10: 

v10

### Issue, Question or Enhancement:

exclude_if doesn't work with 'nil','true','false' values in provided parametrs

Examples:

	// exclude the field if the Field1 is equal to the parameter given:
	Usage: excluded_if=Field1 foobar

	// exclude the field if the Field1 and Field2 is equal to the value respectively:
	Usage: excluded_if=Field1 foo Field2 bar

### Code sample, to showcase or reproduce:

```go
type Struct1 struct {
  Field1 bool
  Field2 *string `validate:"excluded_if=Field1 false"`
}

type Struct2 struct {
  Field1 bool
  Field2 *string `validate:"excluded_if=!Field1"`
}

func main() {
ctx := context.Background()

  vldtr := validator.New()
str := "321321"
vldtr.StructCtx(ctx,Struct1{false, str})

vldtr.StructCtx(ctx, Struct2{false, str})
}

// Output: !panic recovered: Bad field type *int64
```
### Output



Pull request:
fix(#1310): fix excluded_if for pointers
## Fixes Or Enhances
- fixes #1310
- add check for pointers in case of excluded_if

**Make sure that you've checked the boxes below before you submit PR:**
- [x] Tests exist or have been written that cover this particular change.

@go-playground/validator-maintainers

Patch:
diff --git a/baked_in.go b/baked_in.go
index b6fbaaf..d1a3656 100644
--- a/baked_in.go
+++ b/baked_in.go
@@ -1828,7 +1828,14 @@ func requireCheckFieldValue(
 		return int64(field.Len()) == asInt(value)
 
 	case reflect.Bool:
-		return field.Bool() == asBool(value)
+		return field.Bool() == (value == "true")
+
+	case reflect.Ptr:
+		if field.IsNil() {
+			return value == "nil"
+		}
+		// Handle non-nil pointers
+		return requireCheckFieldValue(fl, param, value, defaultNotFoundValue)
 	}
 
 	// default reflect.String:


Test patch:
diff --git a/validator_test.go b/validator_test.go
index 0f96b77..367a6b4 100644
--- a/validator_test.go
+++ b/validator_test.go
@@ -12002,6 +12002,25 @@ func TestExcludedIf(t *testing.T) {
 	errs = validate.Struct(test10)
 	Equal(t, errs, nil)
 
+	test11 := struct {
+		Field1 bool
+  		Field2 *string `validate:"excluded_if=Field1 false"`
+	}{
+		Field1: false,
+		Field2: nil,
+	}
+	errs = validate.Struct(test11)
+	Equal(t, errs, nil)
+
+	test12 := struct {
+		Field1 bool
+		Field2 *string `validate:"excluded_if=Field1 !Field1"`
+	}{
+		Field1: true,
+		Field2: nil,
+	}
+	errs = validate.Struct(test12)
+	Equal(t, errs, nil)
 	// Checks number of params in struct tag is correct
 	defer func() {
 		if r := recover(); r == nil {