findInType traverses a type and identifies elements based on specified callbacks and optional recursion settings.
(t reflect.Type, onType func(reflect.Type, []int) T, onField func(reflect.StructField, []int) T, recurseFields bool, ignore ...string)
| 469 | // findInType traverses a type and identifies elements based on specified callbacks |
| 470 | // and optional recursion settings. |
| 471 | func findInType[T comparable](t reflect.Type, onType func(reflect.Type, []int) T, onField func(reflect.StructField, []int) T, recurseFields bool, ignore ...string) *findResult[T] { |
| 472 | result := &findResult[T]{} |
| 473 | _findInType(t, []int{}, result, onType, onField, recurseFields, make(map[reflect.Type]struct{}), ignore...) |
| 474 | return result |
| 475 | } |
| 476 | |
| 477 | func _findInType[T comparable](t reflect.Type, path []int, result *findResult[T], onType func(reflect.Type, []int) T, onField func(reflect.StructField, []int) T, recurseFields bool, visited map[reflect.Type]struct{}, ignore ...string) { |
| 478 | t = deref(t) |
no test coverage detected
searching dependent graphs…