SetColumnsFromFields Explicityly set column names from fields.
()
| 559 | |
| 560 | // SetColumnsFromFields Explicityly set column names from fields. |
| 561 | func (m *Table) SetColumnsFromFields() { |
| 562 | m.FieldPositions = make(map[string]int, len(m.Fields)) |
| 563 | cols := make([]string, len(m.Fields)) |
| 564 | for idx, f := range m.Fields { |
| 565 | col := strings.ToLower(f.Name) |
| 566 | m.FieldPositions[col] = idx |
| 567 | cols[idx] = col |
| 568 | } |
| 569 | m.cols = cols |
| 570 | } |
| 571 | |
| 572 | // Columns list of all column names. |
| 573 | func (m *Table) Columns() []string { return m.cols } |
no outgoing calls