Raw Markdown View this page on GitHub

Overview

ringbuf is a fixed-size ring buffer for Go, for 1 goroutine that pushes and 1 that pops, without locks.

main.go
b := ringbuf.New[int](1024)
b.Push(42)
v, ok := b.Pop() // 42, true

Concurrency explains what the buffer guarantees.