相关疑难解决方法(0)

如何在golang中比较html/template中列表的长度?

我试图比较golang html/template中列表的长度.但它在html中永远加载.

{{ $length := len .SearchData }} {{ if eq $length "0" }}
    Sorry. No matching results found
{{ end }}
Run Code Online (Sandbox Code Playgroud)

任何人都可以帮我这个吗?

html equals go go-html-template

21
推荐指数
3
解决办法
2万
查看次数

标签 统计

equals ×1

go ×1

go-html-template ×1

html ×1