# continue
> 终止最内层的 range 迭代，并继续执行下一次迭代。
- 官方英文原文：https://gohugo.io/functions/go-template/continue/
- 本页规范地址：https://hugozh.cn/functions/go-template/continue/
- 最近更新：2026-10-02
- 最后提交：912b1d3 chore(site): 添加 static/CNAME（hugozh.cn），供 GitHub Pages 等平台绑定自定义域名
- 签名：continue
- 站点：Hugo 中文文档（https://hugozh.cn/）· 社区维护的非官方中文翻译，如有出入以官方英文原文为准

---
## 用法

这段模板代码：

```go-html-template
{{ $s := slice "foo" "bar" "baz" }}
{{ range $s }}
  {{ if eq . "bar" }}
    {{ continue }}
  {{ end }}
  <p>{{ . }}</p>
{{ end }}
```

渲染结果为：

```html
<p>foo</p>
<p>baz</p>
```

更多信息参见 Go 的 [`text/template`](https://pkg.go.dev/text/template) 文档。

