I was looking at this article:
https://medium.com/@IndianGuru/understanding-go-s-template-package-c5307758fab0
I am wondering how to inject a variable into a string using templating, for example:
func getTemplate(v string) string {
return `CREATE TABLE share_${v} PARTITION OF share FOR VALUES IN (${v});`
}
the example in the article writes the output to stdout, but I need to store the result of the template as a variable, anyone know how?
Something like:
result := getTemplate("0")