chore: use text/template (#17358)
This commit is contained in:
parent
cdc5bdb753
commit
037aeaa63a
1 changed files with 2 additions and 2 deletions
|
|
@ -3,11 +3,11 @@ package util
|
|||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"html/template"
|
||||
"maps"
|
||||
"regexp"
|
||||
"slices"
|
||||
"strings"
|
||||
"text/template"
|
||||
"time"
|
||||
|
||||
"github.com/Masterminds/sprig/v3"
|
||||
|
|
@ -50,7 +50,7 @@ func FormatValue(format string, val interface{}) string {
|
|||
func ReplaceFormatted(s string, kv map[string]interface{}) (string, error) {
|
||||
// Enhanced golang template logic
|
||||
tpl, err := template.New("base").
|
||||
Funcs(sprig.FuncMap()).
|
||||
Funcs(sprig.TxtFuncMap()).
|
||||
Funcs(map[string]any{
|
||||
"timeRound": timeRound,
|
||||
}).Parse(s)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue