use init function to inline template

This commit is contained in:
Pierre Dubouilh
2024-08-04 21:12:56 +02:00
committed by Pierre Dubouilh
parent 1861de0d57
commit 5fbc140e53
2 changed files with 15 additions and 7 deletions
+2 -2
View File
@@ -137,9 +137,9 @@ func replyList(w http.ResponseWriter, r *http.Request, fullPath string, path str
gz, err := gzip.NewWriterLevel(w, gzip.BestSpeed) // BestSpeed is Much Faster than default - base on a very unscientific local test, and only ~30% larger (compression remains still very effective, ~6x)
check(err)
defer gz.Close()
templateParsed.Execute(gz, p)
tmpl.Execute(gz, p)
} else {
templateParsed.Execute(w, p)
tmpl.Execute(w, p)
}
}