The `:=` causes new variables to be created, which means the outer slice stays at nil, and new memory is allocated every time round the loop. Extracted from https://github.com/prometheus/prometheus/pull/16182 Credit to @bwplotka. Signed-off-by: Bryan Boreham <bjboreham@gmail.com> |
||
|---|---|---|
| .. | ||
| checkpoint.go | ||
| checkpoint_test.go | ||
| live_reader.go | ||
| reader.go | ||
| reader_test.go | ||
| watcher.go | ||
| watcher_test.go | ||
| wlog.go | ||
| wlog_test.go | ||