diff --git a/container/gqueue/gqueue_z_example_test.go b/container/gqueue/gqueue_z_example_test.go index f3f414fb7..ba99c51d9 100644 --- a/container/gqueue/gqueue_z_example_test.go +++ b/container/gqueue/gqueue_z_example_test.go @@ -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 // } @@ -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 }