I have a go application reading content from a Markdown file and adding it to a go template file.
var tmpl = template.Must(template.New("").Parse(`//Code generated by go generate
//Please don't change
package cmd
var fooTemplate = ` + "`" + `{{ .FileName }}` + "`"))
and the markdown file has content
## Title
Foo bar
## Description
This is a dummy description using `go` language
The problem is that the markdown syntax has backticks and so the generated go file is broken in syntax. This syntax works here in SO because of the use of triple backticks(```) but doesn't while generating the go file.
Is it possible to create a go file with backticks inside the multiline string by escaping them?