【问题标题】:go template and tab charactergo 模板和制表符
【发布时间】:2020-05-23 14:09:16
【问题描述】:

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

基本上这是我的尝试:

{{ .title }}\t{{ .description }}

现在打印的是“\t”而不是实际的标签

感谢您的帮助!

【问题讨论】:

    标签: go grafana go-templates


    【解决方案1】:

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

    Run it on the playground.

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

    【讨论】:

    • {{"\t"}}(不用打电话print)也足够了。
    猜你喜欢
    • 2014-09-30
    • 2021-04-26
    • 1970-01-01
    • 2023-02-07
    • 2012-09-07
    • 1970-01-01
    • 1970-01-01
    • 2021-04-25
    相关资源
    最近更新 更多