fasthttp некоррктно работает
Пытаюсь использовать fasthttp с шаблонизатором amber, но в браузере получаю пустую страницу
есть такой обработчик
type DTS struct{}
func handler(ctx *fasthttp.RequestCtx) {
compiler := amber.New()
compiler.ParseFile("./templates/index.amber")
tpl, _ := compiler.Compile()
tpl.ExecuteTemplate(ctx, "index.html", DTS{})
}
либо вместо
tpl.ExecuteTemplate(ctx, "index.html", DTS{})
пробую использовать, но ничего не дает
tpl.Execute(ctx, "index.html")
А при обычно пакете net/http все работает, как надо
func handler(w http.ResponseWriter, r *http.Request) {
compiler := amber.New()
compiler.ParseFile("./templates/index.amber")
tpl, _ := compiler.Compile()
tpl.Execute(w, "index.html")
}