This is an experiment of what a priority queue implementation could look like using Go's proposed generics.
Copy the code into the Go2 playground to compile and run. You can also build Go 2 from source by fetching the dev.go2go
release tag
The source code for this has been taken from heap.go and example_pq_test.go. Copyright 2009 The Go Authors. All rights reserved.