I'm trying to serve an html file with echo but whenever I run the program I get that panic error.
// where:
type TemplateRenderer struct {
templates *template.Template
}
func genTemplate(path string) *TemplateRenderer {
tr := &TemplateRenderer{
templates: template.Must(template.ParseFiles(path)),
}
return tr
}
e := echo.New()
renderer := genTemplate("./templates/*.html")
e.Renderer = renderer
panic: template: pattern matches no files: `./templates/*.html`
I've looked around but can't seem to find a solution to the problem. Any ideas? Let me know if any more information is needed.
embedpackage