Var changes, mor robustness against inputs

This commit is contained in:
Simon Martens
2025-09-28 19:01:19 +02:00
parent 2bf6315f50
commit 71a623ec0e
10 changed files with 164 additions and 32 deletions

View File

@@ -425,6 +425,18 @@ func (e *Engine) Globals(data fiber.Map) {
}
}
// UpdateGitGlobals updates the git-related global data
func (e *Engine) UpdateGitGlobals(commit, date, url string) {
e.mu.Lock()
defer e.mu.Unlock()
if e.GlobalData == nil {
e.GlobalData = make(fiber.Map)
}
e.GlobalData["gitCommit"] = commit
e.GlobalData["gitDate"] = date
e.GlobalData["gitURL"] = url
}
func (e *Engine) Load() error {
wg := sync.WaitGroup{}
wg.Add(2)