type Item … type PriorityQueue … func (pq PriorityQueue) Len() int { … } func (pq PriorityQueue) Less(i, j int) bool { … } func (pq PriorityQueue) Swap(i, j int) { … } func (pq *PriorityQueue) Push(x any) { … } func (pq *PriorityQueue) Pop() any { … } // update modifies the priority and value of an Item in the queue. func (pq *PriorityQueue) update(item *Item, value string, priority int) { … } // This example creates a PriorityQueue with some items, adds and manipulates an item, // and then removes the items in priority order. func Example_priorityQueue() { … }