code: func trap(ctx context.Context) chan<- os.Signal {
  	v := ctx.Value("sig")
  	if v == nil {
  		return nil
  	}
  	cancel, ok := v.(func())
  	if cancel == nil || !ok {
  		return nil
  	}
  
  	sigs := make(chan os.Signal, 1)
  	signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)
  	go func() {
  		select {
  		case <-sigs:
  			cancel()
  		case <-ctx.Done():
  		}
  	}()
  	return sigs
  }
docs: // Cleanup for the interrupted case.