diff --git a/handler/app/dirs.go b/handler/app/dirs.go index 18f158ce..592a902e 100644 --- a/handler/app/dirs.go +++ b/handler/app/dirs.go @@ -464,6 +464,7 @@ func (dir Dirs) assets(nameDir, unid string) map[string][2]string { } } } + clear(files) return matches } diff --git a/handler/html3/template.go b/handler/html3/template.go index 2229d11b..8b8bfebf 100644 --- a/handler/html3/template.go +++ b/handler/html3/template.go @@ -26,7 +26,9 @@ const ( func emptyFS(fs embed.FS) bool { entries, err := fs.ReadDir(".") - return err != nil || len(entries) == 0 + result := err != nil || len(entries) == 0 + clear(entries) + return result } // GlobTo returns the path to the template file. diff --git a/handler/htmx/template.go b/handler/htmx/template.go index 3667dbc1..c26a4bf2 100644 --- a/handler/htmx/template.go +++ b/handler/htmx/template.go @@ -25,7 +25,9 @@ func GlobTo(name string) string { func emptyFS(fs embed.FS) bool { entries, err := fs.ReadDir(".") - return err != nil || len(entries) == 0 + result := err != nil || len(entries) == 0 + clear(entries) + return result } // Templates returns a map of the templates.