code: func (r *Reader) WriteTemplate(template *process.Template, permission os.FileMode) error {
  	if template == nil {
  		return errors.Errorf("provided process template is nil")
  	}
  
  	templateData, err := json.Marshal(template)
  	if err != nil {
  		return errors.Errorf("failed to marshal template %s: %v", template.Name, err)
  	}
  
  	templateFile := template.Name + JSONExt
  	filePath := filepath.Join(r.path, templateFile)
  	err = ioutil.WriteFile(filePath, templateData, permission)
  	if err != nil {
  		return errors.Errorf("failed to write template %s to file: %v", templateFile, err)
  	}
  
  	r.log.Debugf("process template file %s written", templateFile)
  
  	return nil
  }
docs: // WriteTemplate creates a new file (defined by template name) and writes it to the reader's path