Fix use of reflect.Ptr

Apparently Ptr is a deprecated name; with the new golangci-lint version
this would cause

  inline: Constant reflect.Ptr should be inlined
This commit is contained in:
Stefan Haller 2026-08-16 16:23:26 +02:00
parent 4820241caf
commit a26899f5ab

View file

@ -144,7 +144,7 @@ func setDefaultVals(rootSchema, schema *jsonschema.Schema, defaults any) {
t := reflect.TypeOf(defaults)
v := reflect.ValueOf(defaults)
if t.Kind() == reflect.Ptr || t.Kind() == reflect.Interface {
if t.Kind() == reflect.Pointer || t.Kind() == reflect.Interface {
t = t.Elem()
v = v.Elem()
}
@ -202,7 +202,7 @@ func isZeroValue(v any) bool {
switch rv.Kind() {
case reflect.Slice, reflect.Map:
return rv.Len() == 0
case reflect.Ptr, reflect.Interface:
case reflect.Pointer, reflect.Interface:
return rv.IsNil()
case reflect.Struct:
for i := range rv.NumField() {