change some example for gqueue

This commit is contained in:
mingzaily
2021-11-03 16:16:03 +08:00
parent bc1d76a796
commit 9c05682605

View File

@ -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
}