如何在 go 模板中加入两个字符串?

bro*_*ick 2 string go-templates

我发现这个文档加入了两个字符串,但这在 go 模板中不起作用。

有没有办法在 go 模板中加入字符串?

Jos*_*hua 6

使用的组合delimitslice,如

{{ delimit (slice "foo" "bar" "buzz") ", " }}
<!-- returns the string "foo, bar, buzz" -->
Run Code Online (Sandbox Code Playgroud)

最初来自gohugo 文档