mirror of
https://gitee.com/johng/gf
synced 2026-06-06 02:25:47 +08:00
change some example for gqueue
This commit is contained in:
@ -94,11 +94,14 @@ func ExampleQueue_Close() {
|
||||
q.Push(i)
|
||||
}
|
||||
|
||||
time.Sleep(time.Millisecond)
|
||||
q.Close()
|
||||
|
||||
fmt.Println(q.Len())
|
||||
fmt.Println(q.Pop())
|
||||
|
||||
// Output:
|
||||
// 0
|
||||
// <nil>
|
||||
}
|
||||
|
||||
@ -108,8 +111,13 @@ func ExampleQueue_Len() {
|
||||
q.Push(1)
|
||||
q.Push(2)
|
||||
|
||||
time.Sleep(time.Millisecond)
|
||||
fmt.Println(q.Len())
|
||||
q.Pop()
|
||||
q.Close()
|
||||
fmt.Println(q.Len())
|
||||
|
||||
// Output:
|
||||
// 2
|
||||
// 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user