mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-12-01 05:24:22 +01:00
Removed unnecessary functions from report template (#2040)
This commit is contained in:
1 parent
ca20267a84
commit
8d1f98c796
2 files changed
+56
-1
No files matched your search
+7
-1
@@ -29,7 +29,13 @@ func NewTemplateReporter(templatePath string) (*TemplateReporter, error) {
|
||||
|
||||
// TODO: Add helper functions like escaping for JSON, XML, etc.
|
||||
t := template.New("custom")
|
||||
t = t.Funcs(sprig.TxtFuncMap())
|
||||
|
||||
funcMap := sprig.TxtFuncMap()
|
||||
delete(funcMap, "env")
|
||||
delete(funcMap, "expandenv")
|
||||
delete(funcMap, "getHostByName")
|
||||
|
||||
t = t.Funcs(funcMap)
|
||||
t, err = t.Parse(templateText)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error parsing file: %w", err)
|
||||
|
||||
Reference in new issue
Block a user