Skip to content

Commit

Permalink
add size example for gqueue
Browse files Browse the repository at this point in the history
  • Loading branch information
mingzaily committed Nov 7, 2021
1 parent 6f64c26 commit df02ca7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions container/gqueue/gqueue_z_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit df02ca7

Please sign in to comment.