Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

text/template: 'Break' on rande #20523

Closed
igramnet opened this issue May 29, 2017 · 3 comments
Closed

text/template: 'Break' on rande #20523

igramnet opened this issue May 29, 2017 · 3 comments

Comments

@igramnet
Copy link

igramnet commented May 29, 2017

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

0.21

What operating system and processor architecture are you using (go env)?

Windows + Ubuntu

What did you do?

Good afternoon. PHP has a loop
If {$ i> 2} break;
How to do this in hugo?

@igramnet igramnet changed the title 'Break' on rande text/template: 'Break' on rande May 29, 2017
@ALTree
Copy link
Member

ALTree commented May 29, 2017

Hi,

the Go project does not use its bug tracker for general discussion or asking questions. The Github bug tracker is only used for tracking bugs and proposals going through the Proposal Process.

Please see the Questions wiki page; it has a list of good places for asking questions. Thanks!

Closing, since this is not a bug.

@ALTree ALTree closed this as completed May 29, 2017
@bep
Copy link
Contributor

bep commented May 29, 2017

This is a valid issue, however not perfectly formulated.

I will try to rephrase:

This is currently not possible with the Go text templates:

{{ range $i, $e := .SomeSlice }}
{{ if gt $i 2 }}
{{ break }}
{{ end }}
{{ end }}

The above example is fictional, of course, since the continue keyword does not exist in the Go template syntax, but it is common enough that people, well, just expect that it exists.

So, this is a valid issue. Maybe not a bug, but it borders one. So, @ALTree you can reopen this or I will create a new one with a better description?

@ALTree
Copy link
Member

ALTree commented May 29, 2017

@bep it's a feature request then? It didn't look like one.

I'm not a text/template expert but if you think it's a reasonable request then sure. We could re-open this and edit the description but at this point it'll be cleaner to just open a new issue. Feel free. Thanks!

@golang golang locked and limited conversation to collaborators May 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants