【发布时间】:2017-01-30 07:49:35
【问题描述】:
我在 golang 中有一个模板,其中有一个看起来像这样的字符串:
<some_html> {{ .SomeOtherHTML }} </some_html>
我希望输出是这样的:
<some_html> <the_other_html/> </some_html>
但我看到的是这样的:
<some_html> <the_other_html/< </some_html>
我也在尝试插入一些 JSON,但 golang 正在转义字符并在不应该出现的地方添加 " 之类的内容。
如何在 golang 中插入 HTML 模板而不发生这种情况?
【问题讨论】:
标签: html json templates go escaping