Skip to content

Commit

Permalink
Fixes extra newline from confs
Browse files Browse the repository at this point in the history
As we are using templates to dynamicaly create confs on conditions,
Often extra newlines are getting added in confs, we should remove them.
  • Loading branch information
auniyal61 committed Sep 4, 2024
1 parent 0ae9f7f commit 9bde700
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/common/util/template_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ func ExecuteTemplateData(templateData string, data interface{}) (string, error)
"add": add,
"lower": lower,
}
// remove extra newlines
templateData = strings.ReplaceAll(templateData, "\n\n\n", "")
tmpl, err := template.New("tmp").Option("missingkey=error").Funcs(funcs).Parse(templateData)
if err != nil {
return "", err
Expand Down

0 comments on commit 9bde700

Please sign in to comment.