go(app): use embedded variable value
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
leo 2023-04-26 23:11:58 +02:00
parent 8c7c84f6f9
commit d99d86a2be
Signed by: wanderer
SSH Key Fingerprint: SHA256:Dp8+iwKHSlrMEHzE3bJnPng70I7LEsa3IJXRH/U+idQ
2 changed files with 8 additions and 5 deletions

View File

@ -6,7 +6,9 @@ import (
"os"
)
func (a *App) getAssets(live bool) http.FileSystem {
func (a *App) getAssets() http.FileSystem {
live := a.config.LiveMode
if live {
a.logger.Info("assets loaded in live mode")
@ -23,7 +25,9 @@ func (a *App) getAssets(live bool) http.FileSystem {
return http.FS(fsys)
}
func (a *App) getTemplates(live bool) fs.FS {
func (a *App) getTemplates() fs.FS {
live := a.config.LiveMode
if live {
a.logger.Info("templates loaded in live mode")

View File

@ -11,9 +11,8 @@ import (
func (a *App) SetupRoutes() {
e := a.E()
conf := a.Config()
liveMode := conf.LiveMode
assets := http.FileServer(a.getAssets(liveMode))
tmpls := a.getTemplates(liveMode)
assets := http.FileServer(a.getAssets())
tmpls := a.getTemplates()
// run this before declaring any handler funcs.
handlers.InitHandlers(a.version, conf, tmpls)