-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
html/template: make FuncMap an alias for text/template.FuncMap #46121
Comments
Do you think any reasonable user programs could break because of this change? I can imagine some artificial cases, like requiring the two types to be different via e.g. reflection, but I don't imagine anyone would be doing that. |
Seems reasonable to me. Adding to minutes. /cc @robpike |
This proposal has been added to the active column of the proposals project |
Seems sound. |
I thought about that, but I couldn't think of a realistic case where it might be a problem, Hyrum's Law notwithstanding. |
Based on the discussion above, this proposal seems like a likely accept. |
No change in consensus, so accepted. 🎉 |
Change https://go.dev/cl/389156 mentions this issue: |
As discussed on Twitter recently, when generics come around, the
html/template
andtext/template
APIs can reasonably be abstracted into a single generic interface, but the fact thatFuncMap
is defined as two separate types makes it a bit harder than it could be.I propose that in
html/template
,FuncMap
shall be defined as an alias as follows:As
html/template
already importstext/template
, there's no problem with a change in the dependency graph, and I can't currently see any potential issues from combining the two types.The text was updated successfully, but these errors were encountered: