ringbuffer
A circular buffer (ring buffer) in Go, implemented io.ReaderWriter interface
rb := New(1024)
// write
rb.Write([]byte("abcd"))
fmt.Println(rb.Length())
fmt.Println(rb.Free())
// read
buf := make([]byte, 4)
rb.Read(buf)
fmt.Println(string(buf))