build: modernize with "go fix -reflecttypefor": use reflect.TypeFor

This commit is contained in:
Nick Craig-Wood
2026-08-21 12:23:31 +01:00
parent a64c0a0fde
commit e20e18d2e0
+1 -1
View File
@@ -287,7 +287,7 @@ func setIfSameType(aPtr any, b any) bool {
}
// Special case: if target is []string and source is a slice or array
if aVal.Type() == reflect.TypeOf([]string(nil)) && (bVal.Kind() == reflect.Slice || bVal.Kind() == reflect.Array) {
if aVal.Type() == reflect.TypeFor[[]string]() && (bVal.Kind() == reflect.Slice || bVal.Kind() == reflect.Array) {
strSlice := make([]string, bVal.Len())
ok := true
for i := 0; i < bVal.Len(); i++ {