MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / getFieldValue

Function getFieldValue

tsunami/ui/table.go:95–103  ·  view source on GitHub ↗

Generic helper to extract field value using either AccessorFn or reflection

(row T, rowIdx int, col TableColumn[T])

Source from the content-addressed store, hash-verified

93
94// Generic helper to extract field value using either AccessorFn or reflection
95func 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
106func findColumnByKey[T any](columns []TableColumn[T], key string) *TableColumn[T] {

Callers 2

sortDataFunction · 0.85
genTableRenderFuncFunction · 0.85

Calls 1

Tested by

no test coverage detected