We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ae1ad2e commit a4fc0d4Copy full SHA for a4fc0d4
datatable.go
@@ -91,9 +91,14 @@ type HeaderTable struct {
91
}
92
93
// Get returns the cell at the provided row offset (skipping the header row)
94
-// and column name (as indicated in the header).
+// and column name (as indicated in the header). If the column name is not
95
+// found, nil is returned.
96
func (h *HeaderTable) Get(row int, col string) *Cell {
- return h.DataTable.Cell(row+1, h.headers[col])
97
+ if v, ok := h.headers[col]; !ok {
98
+ return nil
99
+ } else {
100
+ return h.DataTable.Cell(row+1, v)
101
+ }
102
103
104
// NumRows returns the number of rows in the table (excluding the header row).
0 commit comments