ColumnIndexTry returns the index of the given column name, along with an error if not found.
(name string)
| 96 | // ColumnIndexTry returns the index of the given column name, |
| 97 | // along with an error if not found. |
| 98 | func (dt *Table) ColumnIndexTry(name string) (int, error) { |
| 99 | i, ok := dt.ColumnNameMap[name] |
| 100 | if !ok { |
| 101 | return 0, fmt.Errorf("table.Table ColumnIndex: column named: %v not found", name) |
| 102 | } |
| 103 | return i, nil |
| 104 | } |
| 105 | |
| 106 | // ColumnIndexesByNames returns the indexes of the given column names. |
| 107 | // idxs have -1 if name not found -- see Try version for error message. |
no test coverage detected