fix: ♻️ createTemplateCache pasa a ser un método privado

This commit is contained in:
2024-08-21 22:56:51 +02:00
parent f2fd887f9b
commit 53362dcafd
2 changed files with 5 additions and 4 deletions
+3 -3
View File
@@ -58,7 +58,7 @@ func WithRenderOptions(opts *Render) OptionFunc {
if opts.EnableCache {
re.EnableCache = opts.EnableCache
re.TemplateCache, _ = re.CreateTemplateCache()
re.TemplateCache, _ = re.createTemplateCache()
}
}
}
@@ -101,7 +101,7 @@ func (re *Render) Template(w http.ResponseWriter, r *http.Request, tmpl string,
if re.EnableCache {
tc = re.TemplateCache
} else {
tc, err = re.CreateTemplateCache()
tc, err = re.createTemplateCache()
if err != nil {
log.Println("error creating template cache:", err)
return err
@@ -129,7 +129,7 @@ func (re *Render) Template(w http.ResponseWriter, r *http.Request, tmpl string,
return nil
}
func (re *Render) CreateTemplateCache() (TemplateCache, error) {
func (re *Render) createTemplateCache() (TemplateCache, error) {
myCache := TemplateCache{}
pagesTemplates, err := filepath.Glob(fmt.Sprintf("%s/*.html", re.PageTemplatesPath))