Answers for "text/template golang to string"

Go
0

text/template golang to string

var b bytes.Buffer
t,err := template.New("").Parse("Hello {.}")
if err != nill{ panic(err) }
err = t.Execute(&b, "Lazy Lizard")
if err != nill{ panic(err) }

fmt.Println(b.String())
Posted by: Guest on October-08-2021

Browse Popular Code Answers by Language