code: func newGracefulListener(l net.Listener, wg *sync.WaitGroup) *gracefulListener {
  	gl := &gracefulListener{Listener: l, stop: make(chan error), connWg: wg}
  	go func() {
  		<-gl.stop
  		gl.Lock()
  		gl.stopped = true
  		gl.Unlock()
  		gl.stop <- gl.Listener.Close()
  	}()
  	return gl
  }
docs: // TODO: Should this be a generic graceful listener available in its own package or something?
  // Also, passing in a WaitGroup is a little awkward. Why can't this listener just keep
  // the waitgroup internal to itself?
  // newGracefulListener returns a gracefulListener that wraps l and
  // uses wg (stored in the host server) to count connections.