<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Xss - 标签 - 研发日志 · R&amp;D Log</title><link>https://rd163.visword.com/tags/xss/</link><description>Xss - 标签 - 研发日志 · R&amp;D Log</description><generator>Hugo -- gohugo.io</generator><language>zh-CN</language><managingEditor>whutluohui@gmail.com (小智晖)</managingEditor><webMaster>whutluohui@gmail.com (小智晖)</webMaster><copyright>本作品采用知识共享署名-非商业性使用 4.0 国际许可协议进行许可。</copyright><lastBuildDate>Sun, 12 Jan 2025 00:00:00 +0800</lastBuildDate><atom:link href="https://rd163.visword.com/tags/xss/" rel="self" type="application/rss+xml"/><item><title>Golang 模板</title><link>https://rd163.visword.com/posts/golang-template/</link><pubDate>Sun, 12 Jan 2025 00:00:00 +0800</pubDate><author><name>小智晖</name></author><guid>https://rd163.visword.com/posts/golang-template/</guid><description><![CDATA[<p>模板引擎是 Web 开发里把数据渲染成文本（尤其是 HTML）的基础设施。Go 在标准库里直接提供了 <a href="https://pkg.go.dev/text/template" target="_blank" rel="noopener noreferrer"><code>text/template</code></a> 与 <a href="https://pkg.go.dev/html/template" target="_blank" rel="noopener noreferrer"><code>html/template</code></a> 两个包，接口一致但安全模型不同;生态中还有 <a href="https://github.com/flosch/pongo2" target="_blank" rel="noopener noreferrer"><code>pongo2</code></a>、<a href="https://github.com/valyala/quicktemplate" target="_blank" rel="noopener noreferrer"><code>quicktemplate</code></a> 等第三方方案。本文记录 Go 模板的标准库用法、最容易踩坑的「自动转义」机制，以及选型时的性能参考。</p>]]></description></item></channel></rss>