diff --git a/priorityqueue.go b/priorityqueue.go index 7d700a3..a2330a8 100644 --- a/priorityqueue.go +++ b/priorityqueue.go @@ -41,7 +41,8 @@ func (q *PriorityQueue[T]) Pop() (T, bool) { defer q.lock.Unlock() if len(q.items) == 0 { - return nil, false + var res T + return res, false } item := q.items[0]