djLint is a Go template linter and a Go template formatter! Take advantage of the pre-build profile when linting and formatting your templates with djLint.
Go templates (text/template, html/template) also power Hugo themes and Helm charts, so use this same profile for them.
djlint /path/to/templates --profile=golang
Configure djLint in your projects pyproject.toml.
[tool.djlint]
profile="golang"