Last returns the last of item.
()
| 36 | |
| 37 | // Last returns the last of item. |
| 38 | func (q *Queue) Last() interface{} { |
| 39 | if len(q.items) == 0 { |
| 40 | return nil |
| 41 | } |
| 42 | |
| 43 | q.lock.RLock() |
| 44 | last := q.items[len(q.items)-1] |
| 45 | q.lock.RUnlock() |
| 46 | return last |
| 47 | } |
| 48 | |
| 49 | // Copy get the copy of queue. |
| 50 | func (q *Queue) Copy() []interface{} { |
nothing calls this directly
no outgoing calls
no test coverage detected