code: func watchErrorStream(errorStream io.Reader, d errorStreamDecoder) chan error {
  	errorChan := make(chan error)
  
  	go func() {
  		defer runtime.HandleCrash()
  
  		message, err := ioutil.ReadAll(errorStream)
  		switch {
  		case err != nil && err != io.EOF:
  			errorChan <- fmt.Errorf("error reading from error stream: %s", err)
  		case len(message) > 0:
  			errorChan <- d.decode(message)
  		default:
  			errorChan <- nil
  		}
  		close(errorChan)
  	}()
  
  	return errorChan
  }
docs: // watchErrorStream watches the errorStream for remote command error data,
  // decodes it with the given errorStreamDecoder, sends the decoded error (or nil if the remote
  // command exited successfully) to the returned error channel, and closes it.
  // This function returns immediately.