go 模板和制表符

Yom*_*ain 1 go go-templates grafana

我想使用 go 模板语法在字符串中插入制表符。

基本上这是我的尝试:

{{ .title }}\t{{ .description }}
Run Code Online (Sandbox Code Playgroud)

现在打印的是“\t”而不是实际的选项卡

感谢您的帮助 !

Cer*_*món 6

替换\t为制表符或使用{{"\t"}}.

在操场上运行它

(h/t 至 icza 以简化编辑)