Update the row at index
(at int, row Row)
| 67 | |
| 68 | // Update the row at index |
| 69 | func (t *DataTable) Update(at int, row Row) error { |
| 70 | if row == nil { |
| 71 | row = make(Row, 0) |
| 72 | } |
| 73 | |
| 74 | for _, col := range t.cols { |
| 75 | if col.IsComputed() { |
| 76 | continue |
| 77 | } |
| 78 | cell, ok := row[col.name] |
| 79 | if ok { |
| 80 | if err := col.serie.Set(at, cell); err != nil { |
| 81 | err := errors.Wrapf(err, "col %s", col.name) |
| 82 | return errors.Wrap(err, ErrUpdateRow.Error()) |
| 83 | } |
| 84 | continue |
| 85 | } |
| 86 | if err := col.serie.Set(at, nil); err != nil { |
| 87 | err := errors.Wrapf(err, "col %s", col.name) |
| 88 | return errors.Wrap(err, ErrUpdateRow.Error()) |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | return nil |
| 93 | } |
nothing calls this directly
no test coverage detected