Как предотвратить экранирование ' в ' в шаблоне html:
package main
import (
    "html/template"
    "os"
)
const tmpl = `<html>
    <head>
        <title>{{.Title}}</title>
    </head>
</html>`
func main() {
    t := template.Must(template.New("ex").Parse(tmpl))
    v := map[string]interface{}{
        "Title": template.HTML("Hello World'"),
    }
    t.Execute(os.Stdout, v)
}
Он выводит:
<html>
    <head>
        <title>Hello World'</title>
    </head>
</html>
Желаемый результат:
<html>
    <head>
        <title>Hello World'</title>
    </head>
</html>
 
                                                                     
                                                                    