mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-28 20:39:40 -08:00
fix: remove map cache
This commit is contained in:
parent
0fb5951375
commit
b8e8eddd01
|
@ -9,21 +9,16 @@ import (
|
|||
"github.com/Masterminds/sprig/v3"
|
||||
)
|
||||
|
||||
var funcMapCache map[string]interface{}
|
||||
|
||||
func funcMap() template.FuncMap {
|
||||
if funcMapCache != nil {
|
||||
return template.FuncMap(funcMapCache)
|
||||
}
|
||||
funcMapCache = map[string]interface{}{
|
||||
funcMap := map[string]interface{}{
|
||||
"secondsRound": secondsRound,
|
||||
}
|
||||
for key, fun := range sprig.TxtFuncMap() {
|
||||
if _, ok := funcMapCache[key]; !ok {
|
||||
funcMapCache[key] = fun
|
||||
if _, ok := funcMap[key]; !ok {
|
||||
funcMap[key] = fun
|
||||
}
|
||||
}
|
||||
return template.FuncMap(funcMapCache)
|
||||
return template.FuncMap(funcMap)
|
||||
}
|
||||
|
||||
func parseSeconds(seconds interface{}) (int, error) {
|
||||
|
|
Loading…
Reference in a new issue