sliceElementValue returns an underlying non-pointer [reflect.Value] of slice element at given index or ElementValue if out of range.
(si int)
| 501 | // sliceElementValue returns an underlying non-pointer [reflect.Value] |
| 502 | // of slice element at given index or ElementValue if out of range. |
| 503 | func (lb *ListBase) sliceElementValue(si int) reflect.Value { |
| 504 | var val reflect.Value |
| 505 | if si < lb.SliceSize { |
| 506 | val = reflectx.Underlying(lb.sliceUnderlying.Index(si)) // deal with pointer lists |
| 507 | } else { |
| 508 | val = lb.elementValue |
| 509 | } |
| 510 | if !val.IsValid() { |
| 511 | val = lb.elementValue |
| 512 | } |
| 513 | return val |
| 514 | } |
| 515 | |
| 516 | func (lb *ListBase) MakeGrid(p *tree.Plan, maker func(p *tree.Plan)) { |
| 517 | tree.AddAt(p, "grid", func(w *ListGrid) { |
no test coverage detected