code: func getUnitFileFromTemplate(cCmd *cobra.Command, uni *unit.UnitNameInfo, fileName string) (*unit.UnitFile, error) {
  	var uf *unit.UnitFile
  
  	tmpl, err := cAPI.Unit(uni.Template)
  	if err != nil {
  		return nil, fmt.Errorf("error retrieving template Unit(%s) from Registry: %v", uni.Template, err)
  	}
  
  	if tmpl != nil {
  		isLocalUnitDifferent(cCmd, fileName, tmpl, false)
  		uf = schema.MapSchemaUnitOptionsToUnitFile(tmpl.Options)
  		log.Debugf("Template Unit(%s) found in registry", uni.Template)
  	} else {
  		// Finally, if we could not find a template unit in the Registry,
  		// check the local disk for one instead
  		filePath := path.Join(path.Dir(fileName), uni.Template)
  		if _, err := os.Stat(filePath); os.IsNotExist(err) {
  			return nil, fmt.Errorf("unable to find template Unit(%s) in Registry or on filesystem", uni.Template)
  		}
  
  		uf, err = getUnitFromFile(filePath)
  		if err != nil {
  			return nil, fmt.Errorf("unable to load template Unit(%s) from file: %v", uni.Template, err)
  		}
  	}
  
  	return uf, nil
  }
docs: // getUnitFileFromTemplate attempts to get a Unit from a template unit that
  // is either in the registry or on the file system
  // It takes two arguments, the template information and the unit file name
  // It returns the Unit or nil; and any error encountered