How to insert a string inside another string using Go lang
You could turn the first string into a template for Sprintf. It would look like this:
p := "</table>%s</body></html>"
out := fmt.Sprintf(p,"<pagebreak />")
Working code here: https://play.golang.org/p/AInfyQwpy2
You can simply use slice operations on the string:
package main
func main() {
p := "green"
index := 2
q := p[:index] + "HI" + p[index:]
fmt.Println(p, q)
}
Working example: https://play.golang.org/p/01phuBKuBB