We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 24370be + 336e707 commit 1f6e0b7Copy full SHA for 1f6e0b7
buffer/ring_growing.go
@@ -70,3 +70,13 @@ func (r *RingGrowing) WriteOne(data interface{}) {
70
r.data[(r.readable+r.beg)%r.n] = data
71
r.readable++
72
}
73
+
74
+// Len returns the number of items in the buffer.
75
+func (r *RingGrowing) Len() int {
76
+ return r.readable
77
+}
78
79
+// Cap returns the capacity of the buffer.
80
+func (r *RingGrowing) Cap() int {
81
+ return r.n
82
0 commit comments