Recently I implemented a heap in GO. To implement a heap, you have to implement Push() and Pop() as well as the 3 methods for sort: Less(),, Swap(), and Len(). For my heap, I never had to Push or Pop, I only had to initialize the heap and repeatedly "Fix" the top element of the heap. As it turns out the Init and Fix functions only use the 3 sorting methods of the heap. They don't use Push or Pop. So when I ran test coverage, I found that my Push and Pop implementations weren't covered. I can't leave my Push and Pop implementation out because the Init and Fix methods require heaps with all 5 methods. What do I do?
What is the preferred way in GO to implement methods of an interface that aren't really needed? Why don't the Init and Fix methods of container/heap just accept a sort.Interface?