Tested On latest version. https://golang.org/pkg/text/template/#hdr-Text_and_spaces {{end}} ,{{-end}},{{end -}},{{- end -}} : All working fine but.. {{end-}} Have bug. 
Tested On latest version.
https://golang.org/pkg/text/template/#hdr-Text_and_spaces
{{end}} ,{{-end}},{{end -}},{{- end -}} : All working fine but..
{{end-}} Have bug.