A Fair, Cancelable Semaphore in Go

Building a fair, cancelable semaphore in Go and the subtle concurrency issues involved.