Skip to content
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

refactor: use .gohtml extension rather than suffixing templates with _template #1388

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/output/html.go
Original file line number Diff line number Diff line change
Expand Up @@ -525,5 +525,5 @@ func PrintHTMLResults(vulnResult *models.VulnerabilityResults, outputWriter io.W
tmpl := template.Must(template.New("").Funcs(funcMap).ParseFS(templates, TemplateDir))

// Execute template
return tmpl.ExecuteTemplate(outputWriter, "report_template.html", htmlResult)
return tmpl.ExecuteTemplate(outputWriter, "report.gohtml", htmlResult)
}
2 changes: 2 additions & 0 deletions internal/output/html/package_view.gohtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{{ $allPackageResults := getAllPackageResults .}}
{{ template "package_table.gohtml" $allPackageResults }}
2 changes: 0 additions & 2 deletions internal/output/html/package_view_template.html

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ <h2>Scanning Results</h2>

<div id="package-tab" class="view-tab">
<h3>Vulnerable Package Summary</h3>
{{template "package_view_template.html" .EcosystemResults}}
{{template "package_view.gohtml" .EcosystemResults}}
</div>

<div id="vuln-tab" class="view-tab">
Expand All @@ -54,7 +54,7 @@ <h3>Source: {{ .Source }}</h3>
{{ .HTMLVulnCount.Called }} known vulnerabilities found.
</p>

{{template "vuln_view_template.html" .}} {{ end }}
{{template "vuln_view.gohtml" .}} {{ end }}
</div>
</div>
{{ end }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{$calledVulns := getAllVulns .PackageResults true}}
{{$uncalledVulns := getAllVulns .PackageResults false}}
{{ if ne .CalledPackageCount 0}}
{{template "vuln_table_template.html" $calledVulns}}
{{template "vuln_table.gohtml" $calledVulns}}
{{ end }}

{{ if ne .UncalledPackageCount 0}}
Expand All @@ -13,7 +13,7 @@ <h4>Uncalled vulnerabilities</h4>
Found {{ .UncalledPackageCount }} package(s) with issues,
{{.HTMLVulnCount.Uncalled }} known vulnerabilities found.
</p>
{{template "vuln_table_template.html" $uncalledVulns }}
{{template "vuln_table.gohtml" $uncalledVulns }}
</div>
</details>
{{ end }}
Loading