I have a folder with different templates in golang. The main template is main.html and there is also a footer.html and header.html. Footer and Header are loaded with
{{template "footer.html" .}}
in main.html.
I am using this to parse the files
templates, _ := template.ParseGlob("Templates/" + template_name + "/*.html")
because there are other directories with different file names used aswell. So I don't want to use parseFiles.
However, the template that is displayed is always the first one in alphabetical order, e.g. footer.html. If I rename main.html to a.html the template gets displayed the way I want it to (so loading the main template and executing footer and header inside of it).
I couldn't find any documentation how to tell golang which template to use first. Is there a way to do that?