text/template: Why is there no support for "kebab-case" template variables? #44789
Labels
FrozenDueToAge
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Hi
Is there a particular reason template variables can't contain dashes?
I'm aware of the
index
function. Just wondering why not support templates with kebab case directly using the prettier syntax.The fix seems pretty simple in
template/parse/lex.go
What side effects can this change have?
Thanks.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
https://play.golang.org/p/NT4dgt0abWi
What did you expect to see?
world! items
What did you see instead?
panic: template: test:1: bad character U+002D '-'
The text was updated successfully, but these errors were encountered: