mirror of
https://gitee.com/johng/gf
synced 2026-06-06 16:21:40 +08:00
add size example for gqueue
This commit is contained in:
@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user