1
0
mirror of https://github.com/nxshock/gron.git synced 2024-11-27 03:41:00 +05:00
gron/strutils.go

14 lines
288 B
Go
Raw Permalink Normal View History

2022-06-21 22:14:50 +05:00
package main
import (
"strings"
"text/template"
)
func format(fmt string, v interface{}) string {
t := new(template.Template)
b := new(strings.Builder)
2022-11-20 14:44:03 +05:00
_ = template.Must(t.Parse(fmt)).Execute(b, v) // TODO: обработать возможные ошибки
2022-06-21 22:14:50 +05:00
return b.String()
}