add size example for gqueue

This commit is contained in:
mingzaily
2021-11-07 16:52:28 +08:00
parent 6f64c26349
commit df02ca764f

View File

@ -116,3 +116,16 @@ func ExampleQueue_Len() {
// Output:
// 2
}
func ExampleQueue_Size() {
q := gqueue.New()
q.Push(1)
q.Push(2)
// Size is alias of Len.
fmt.Println(q.Size())
// Output:
// 2
}