Generic helper to extract field value using either AccessorFn or reflection
(row T, rowIdx int, col TableColumn[T])
| 93 | |
| 94 | // Generic helper to extract field value using either AccessorFn or reflection |
| 95 | func getFieldValue[T any](row T, rowIdx int, col TableColumn[T]) any { |
| 96 | if col.AccessorFn != nil { |
| 97 | return col.AccessorFn(RowContext[T]{ |
| 98 | Data: row, |
| 99 | RowIdx: rowIdx, |
| 100 | }) |
| 101 | } |
| 102 | return getFieldValueWithReflection(row, col.AccessorKey) |
| 103 | } |
| 104 | |
| 105 | // Helper to find column by accessor key |
| 106 | func findColumnByKey[T any](columns []TableColumn[T], key string) *TableColumn[T] { |
no test coverage detected