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: Funcs accepts names with '-' but won't allow calling them #9685

Closed
anacrolix opened this issue Jan 25, 2015 · 4 comments
Closed

text/template: Funcs accepts names with '-' but won't allow calling them #9685

anacrolix opened this issue Jan 25, 2015 · 4 comments
Assignees
Milestone

Comments

@anacrolix
Copy link
Contributor

@anacrolix anacrolix commented Jan 25, 2015

I've given a valid function but with a name containing '-'. Attempting to call it from a template:

panic: template: index.html:64: unexpected bad character U+002D '-' in command
@minux
Copy link
Member

@minux minux commented Jan 29, 2015

I agree that we should reject uncallable Funcs.

@minux minux added the repo-main label Jan 29, 2015
@minux minux added this to the Go1.5 milestone Jan 29, 2015
@rsc rsc removed the repo-main label Apr 14, 2015
@gopherbot
Copy link

@gopherbot gopherbot commented Apr 29, 2015

CL https://golang.org/cl/9470 mentions this issue.

@robpike
Copy link
Contributor

@robpike robpike commented May 8, 2015

I am confused now. How did you get a panic? The parser correctly returns an error for a template that attempts to invoke such a function.

I'm starting to wonder if the original CL (tweaked) is all that's required.

@robpike robpike modified the milestones: Go1.6, Go1.5 Jul 6, 2015
@gopherbot
Copy link

@gopherbot gopherbot commented Sep 14, 2015

CL https://golang.org/cl/14562 mentions this issue.

@robpike robpike closed this in dbfd908 Sep 15, 2015
@golang golang locked and limited conversation to collaborators Sep 22, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.