看golang html包中的escape.go 文件会发现有个这样的定义
var htmlEscaper = strings.NewReplacer(
`&`, "&",
`'`, "'", // "'" is shorter than "'" and apos was not in HTML until HTML5.
`<`, "<",
`>`, ">",
`"`, """, // """ is shorter than """.
)
其中使用到 `` 语法, 目前理解应该是不转义纯字符串的意思
有疑问加站长微信联系(非本文作者)