我有一个切片,我在go中打印到一个html文件:
<ul> {{range .arr}} <li>{{.}}</li> {{end}} </ul>
如果len(arr) > 5,如何仅打印切片的前5个元素?
len(arr) > 5
html go
go ×1
html ×1