Skip to content

Improve error message when partial has two return statements #11708

@jmooring

Description

@jmooring

I know the return statement returns immediately regardless of conditional blocks, and that's fine. The problem is that the error message is unexpected.

layouts/all.html

{{ if true }}
  {{ return true }}
{{ else }}
  {{ return false }}
{{ end }}

The error message is:

execute of template failed: template: all.html:2:5: executing "all.html" at : wrong number of args for return: want 0 got 1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions