Skip to content

Commit f8ddb78

Browse files
committed
fix(govet): inline deprecated reflect.Ptr to reflect.Pointer
The govet inline analyzer flags reflect.Ptr as a deprecated alias. reflect.Pointer was introduced in Go 1.18 as the preferred name and both constants share the same underlying value, so this is a pure rename. Without the change, golangci-lint blocks merges on every file that still references reflect.Ptr (10 occurrences across 4 files; the run reports only 3 due to the default max-same-issues=3 cap).
1 parent c4211ba commit f8ddb78

4 files changed

Lines changed: 10 additions & 10 deletions

File tree

internal/llm/validator/model_validator.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func WrapValidatorFunc(fn func(*ValidationContext, any, ValidatorFunc) (any, err
6161
func ValidateFieldMatch(field1, field2 string) func(any) error {
6262
return func(v any) error {
6363
val := reflect.ValueOf(v)
64-
if val.Kind() == reflect.Ptr {
64+
if val.Kind() == reflect.Pointer {
6565
val = val.Elem()
6666
}
6767

@@ -88,7 +88,7 @@ func ValidateFieldMatch(field1, field2 string) func(any) error {
8888
func ValidateDateRange(startField, endField string, message string) func(any) error {
8989
return func(v any) error {
9090
val := reflect.ValueOf(v)
91-
if val.Kind() == reflect.Ptr {
91+
if val.Kind() == reflect.Pointer {
9292
val = val.Elem()
9393
}
9494

@@ -128,7 +128,7 @@ func ValidateDateRange(startField, endField string, message string) func(any) er
128128
func ValidateConditionalRequired(conditionField string, conditionValue any, requiredField string) func(any) error {
129129
return func(v any) error {
130130
val := reflect.ValueOf(v)
131-
if val.Kind() == reflect.Ptr {
131+
if val.Kind() == reflect.Pointer {
132132
val = val.Elem()
133133
}
134134

@@ -159,7 +159,7 @@ func ValidateConditionalRequired(conditionField string, conditionValue any, requ
159159
func ValidateAtLeastOne(fields ...string) func(any) error {
160160
return func(v any) error {
161161
val := reflect.ValueOf(v)
162-
if val.Kind() == reflect.Ptr {
162+
if val.Kind() == reflect.Pointer {
163163
val = val.Elem()
164164
}
165165

@@ -182,7 +182,7 @@ func ValidateAtLeastOne(fields ...string) func(any) error {
182182
func ValidateMutuallyExclusive(fields ...string) func(any) error {
183183
return func(v any) error {
184184
val := reflect.ValueOf(v)
185-
if val.Kind() == reflect.Ptr {
185+
if val.Kind() == reflect.Pointer {
186186
val = val.Elem()
187187
}
188188

pkg/llm/provider/structured.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ func SchemaFromStruct(t reflect.Type) *Schema {
411411

412412
func generateSchemaFromType(t reflect.Type) *Schema {
413413
// Handle pointers
414-
if t.Kind() == reflect.Ptr {
414+
if t.Kind() == reflect.Pointer {
415415
t = t.Elem()
416416
}
417417

pkg/mcp/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ func generateSchemaFromType(v any) (Schema, error) {
210210
t := reflect.TypeOf(v)
211211

212212
// Handle pointer types
213-
if t.Kind() == reflect.Ptr {
213+
if t.Kind() == reflect.Pointer {
214214
t = t.Elem()
215215
}
216216

@@ -267,7 +267,7 @@ func generateSchemaFromType(v any) (Schema, error) {
267267
// typeToSchemaField converts a reflect.Type to a SchemaField
268268
func typeToSchemaField(t reflect.Type) SchemaField {
269269
// Handle pointer types
270-
if t.Kind() == reflect.Ptr {
270+
if t.Kind() == reflect.Pointer {
271271
t = t.Elem()
272272
}
273273

pkg/mcp/typed_tools.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func generateSchema[T any]() Schema {
9393
typ := reflect.TypeOf(t)
9494

9595
// Handle pointer types
96-
if typ.Kind() == reflect.Ptr {
96+
if typ.Kind() == reflect.Pointer {
9797
typ = typ.Elem()
9898
}
9999

@@ -151,7 +151,7 @@ func parseJSONFieldName(tag string, defaultName string) string {
151151
// goTypeToJSONType converts Go types to JSON schema types
152152
func goTypeToJSONType(t reflect.Type) string {
153153
// Handle pointer types
154-
if t.Kind() == reflect.Ptr {
154+
if t.Kind() == reflect.Pointer {
155155
t = t.Elem()
156156
}
157157

0 commit comments

Comments
 (0)