List returns a list of all the items; it returns the object from the most recent Delta. You should treat the items returned inside the deltas as immutable.
()
| 338 | // from the most recent Delta. |
| 339 | // You should treat the items returned inside the deltas as immutable. |
| 340 | func (f *DeltaFIFO) List() []interface{} { |
| 341 | f.lock.RLock() |
| 342 | defer f.lock.RUnlock() |
| 343 | return f.listLocked() |
| 344 | } |
| 345 | |
| 346 | func (f *DeltaFIFO) listLocked() []interface{} { |
| 347 | list := make([]interface{}, 0, len(f.items)) |