mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-01-29 20:10:56 -08:00
refactor(template): rename files
This commit is contained in:
parent
d5c34b58da
commit
eef50268a9
19
src/template/func_map.go
Normal file
19
src/template/func_map.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
package template
|
||||
|
||||
import (
|
||||
"text/template"
|
||||
|
||||
"github.com/Masterminds/sprig/v3"
|
||||
)
|
||||
|
||||
func funcMap() template.FuncMap {
|
||||
funcMap := map[string]interface{}{
|
||||
"secondsRound": secondsRound,
|
||||
}
|
||||
for key, fun := range sprig.TxtFuncMap() {
|
||||
if _, ok := funcMap[key]; !ok {
|
||||
funcMap[key] = fun
|
||||
}
|
||||
}
|
||||
return template.FuncMap(funcMap)
|
||||
}
|
|
@ -4,23 +4,8 @@ import (
|
|||
"errors"
|
||||
"strconv"
|
||||
"strings"
|
||||
"text/template"
|
||||
|
||||
"github.com/Masterminds/sprig/v3"
|
||||
)
|
||||
|
||||
func funcMap() template.FuncMap {
|
||||
funcMap := map[string]interface{}{
|
||||
"secondsRound": secondsRound,
|
||||
}
|
||||
for key, fun := range sprig.TxtFuncMap() {
|
||||
if _, ok := funcMap[key]; !ok {
|
||||
funcMap[key] = fun
|
||||
}
|
||||
}
|
||||
return template.FuncMap(funcMap)
|
||||
}
|
||||
|
||||
func parseSeconds(seconds interface{}) (int, error) {
|
||||
switch seconds := seconds.(type) {
|
||||
default:
|
Loading…
Reference in a new issue