From 655b6b211ae6df0186abd740f248939f7ddeaec1 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Mon, 31 Mar 2025 16:59:18 +0800 Subject: Add descriptive comments to most Go functions --- resources.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'resources.go') diff --git a/resources.go b/resources.go index 015f33f..567976d 100644 --- a/resources.go +++ b/resources.go @@ -26,6 +26,7 @@ var resourcesFS embed.FS var templates *template.Template +// loadTemplates minifies and loads HTML templates. func loadTemplates() (err error) { minifier := minify.New() minifierOptions := html.Minifier{ @@ -36,7 +37,6 @@ func loadTemplates() (err error) { templates = template.New("templates").Funcs(template.FuncMap{ "first_line": firstLine, - "base_name": baseName, "path_escape": pathEscape, "query_escape": queryEscape, "dereference_error": dereferenceOrZero[error], @@ -73,6 +73,8 @@ var ( manHandler http.Handler ) +// This init sets up static and man handlers. The resulting handlers must be +// used in the HTTP router, and do nothing unless called from elsewhere. func init() { staticFS, err := fs.Sub(resourcesFS, "static") if err != nil { -- cgit v1.2.3