The comments in his code are reminiscent of programming by contract (an idea I believe Djikstra himself was fond of). In Go the types of the interfaces are statically checked, which is good (in Python or Ruby, this isn't the case), but the contract the interface represents has to remain in comments and unit tests.
It would be nice to be able to specify tests that every implementor of the Heap interface must pass?
I am a fan of programming by contract myself, but I'm not quite sure it could be pasted onto Go's interfaces quite so simply. In the case of Heap perhaps it could be done in a straight forward way, but what about more generic things that have more to do with side-effects?
It would be nice to be able to specify tests that every implementor of the Heap interface must pass?