break
Used with the range statement, stops the innermost iteration and bypasses all remaining iterations.
Syntax
break
This template code:
{{ $s := slice "foo" "bar" "baz" }}
{{ range $s }}
{{ if eq . "bar" }}
{{ break }}
{{ end }}
<p>{{ . }}</p>
{{ end }}
Is rendered to:
<p>foo</p>
See Go’s text/template documentation for more information.
Last updated:
December 4, 2023
:
Squashed 'docs/' changes from 4d936aee6..4dd2d6415 (35dec7c96)
Improve this page