code: func (c *Config) CopyToPipe(iop *cio.DirectIO) {
  	copyFunc := func(w io.Writer, r io.ReadCloser) {
  		c.Add(1)
  		go func() {
  			if _, err := pools.Copy(w, r); err != nil {
  				logrus.Errorf("stream copy error: %v", err)
  			}
  			r.Close()
  			c.Done()
  		}()
  	}
  
  	if iop.Stdout != nil {
  		copyFunc(c.Stdout(), iop.Stdout)
  	}
  	if iop.Stderr != nil {
  		copyFunc(c.Stderr(), iop.Stderr)
  	}
  
  	if stdin := c.Stdin(); stdin != nil {
  		if iop.Stdin != nil {
  			go func() {
  				pools.Copy(iop.Stdin, stdin)
  				if err := iop.Stdin.Close(); err != nil {
  					logrus.Warnf("failed to close stdin: %v", err)
  				}
  			}()
  		}
  	}
  }
docs: // CopyToPipe connects streamconfig with a libcontainerd.IOPipe