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
Milestone

Comments

@anacrolix
Copy link
Contributor

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 commented Jan 29, 2015

I agree that we should reject uncallable Funcs.

@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

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

@robpike
Copy link
Contributor

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

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

@golang golang locked and limited conversation to collaborators Sep 22, 2016
@rsc rsc unassigned robpike Jun 23, 2022
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

5 participants