code: func dispatchSig(stop chan<- error) {
  	sigChan := make(chan os.Signal)
  	signal.Notify(
  		sigChan,
  		syscall.SIGTERM,
  		syscall.SIGHUP,
  		syscall.SIGINT,
  	)
  
  	go func() {
  		diag.Println("Waiting for signal")
  		sig := <-sigChan
  		diag.Printf("Received signal %v\n", sig)
  		close(stop)
  	}()
  }
docs: // dispatchSig launches a goroutine and closes the given stop channel
  // when SIGTERM, SIGHUP, or SIGINT is received.