Skip to content

proposal: text/template: add {{break 2}} and {{continue 2}} support #65090

@Drugoy

Description

@Drugoy

Proposal Details

Issue #20531 introduced {{break}} and {{continue}} support, but they are currently limited to the innermost {{range}}.
I'd like to be able to {{break}} 2nd level {{range}} from inside an {{if ...}} block of an inner {{range}} block (to stop parsing a bigger list of objects when I've found what I was looking for).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions