MCPcopy Index your code
hub / github.com/eapache/queue / Peek

Method Peek

queue.go:63–68  ·  view source on GitHub ↗

Peek returns the element at the head of the queue. This call panics if the queue is empty.

()

Source from the content-addressed store, hash-verified

61// Peek returns the element at the head of the queue. This call panics
62// if the queue is empty.
63func (q *Queue) Peek() interface{} {
64 if q.count <= 0 {
65 panic("queue: Peek() called on empty queue")
66 }
67 return q.buf[q.head]
68}
69
70// Get returns the element at index i in the queue. If the index is
71// invalid, the call will panic. This method accepts both positive and

Callers 5

TestQueueSimpleFunction · 0.80
TestQueueWrappingFunction · 0.80
BenchmarkQueueSerialFunction · 0.80
BenchmarkQueueTickTockFunction · 0.80

Calls

no outgoing calls

Tested by 5

TestQueueSimpleFunction · 0.64
TestQueueWrappingFunction · 0.64
BenchmarkQueueSerialFunction · 0.64
BenchmarkQueueTickTockFunction · 0.64