code: func (r *writer) write(e Event) (err error) {
  	// Marshal
  	var b []byte
  	if b, err = json.Marshal(e); err != nil {
  		return errors.Wrapf(err, "Marshaling %+v failed", e)
  	}
  
  	// Write
  	astilog.Debugf("Sending to Astilectron: %s", b)
  	if _, err = r.w.Write(append(b, '\n')); err != nil {
  		return errors.Wrapf(err, "Writing %s failed", b)
  	}
  	return
  }
docs: // write writes to the stdin