type IntHeap … func (h IntHeap) Len() int { … } func (h IntHeap) Less(i, j int) bool { … } func (h IntHeap) Swap(i, j int) { … } func (h *IntHeap) Push(x any) { … } func (h *IntHeap) Pop() any { … } // This example inserts several ints into an IntHeap, checks the minimum, // and removes them in order of priority. func Example_intHeap() { … }