Skip to content

handle custom templates #671

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

handle custom templates #671

wants to merge 1 commit into from

Conversation

hk10111
Copy link
Member

@hk10111 hk10111 commented Mar 7, 2025

Change Description

Testing

@Copilot Copilot AI review requested due to automatic review settings March 7, 2025 05:42
@hk10111 hk10111 requested a review from a team as a code owner March 7, 2025 05:42
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR aims to handle custom templates by updating the renderTemplate function.

  • Removed the direct usage of getEnvOrDefault and splitToMapDefaults.
  • Added a custom template function map with a placeholder for future custom functions.

Reviewed Changes

File Description
base-java/ub/ub.go Updates renderTemplate to support custom template functions

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

base-java/ub/ub.go:139

  • Go does not allow named function declarations inside another function. Consider assigning an anonymous function to a variable or moving the buildTemplate function to package scope.
func buildTemplate(writer io.Writer, template template.Template) error{

@@ -134,25 +134,17 @@ func path(filePath string, operation string) (bool, error) {
}

func renderTemplate(templateFilePath string) error {
// Define a function map to handle custom template functions
Copy link
Preview

Copilot AI Mar 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The updated renderTemplate function no longer parses the template file or returns a value, which could result in runtime errors. Please restore the parsing logic and a return statement to ensure the function completes its intended operation.

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant