github.com/rjrivero/ring (go): Package ring provides support for circular fixed-size data structures, like (LIFO) Stacks and (FIFO) Queues, that wrap around once they reach a certain maximum size.  Rings should be paired with arrays or slices. The ring will manage the ring head (the oldest item pushed to the ring) and tail (the most recent item pushed to the ring) as offsets into the array or slice, e.g:  If you keep pushing items, the tail of the ring will eventually wrap around the end of the slice, until it reaches the head. Once that happens, the ring is full and pushing more items will evict the oldest ones, moving the head of the ring forward.
Keywords: golang|queue|ring|stack