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

14 lines
284 B
Go
Raw 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)
template.Must(t.Parse(fmt)).Execute(b, v) // TODO: обработать возможные ошибки
return b.String()
}