-
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: ParseFiles throws away files with the same filename base #14320
Comments
An added note: The workaround in the case above is to use |
When we originally designed We could patch up That leaves us with a documentation fix, which is easily done. I will prepare it now, but I'm not happy about it. cc @robpike in case he has other ideas. |
CL https://golang.org/cl/21824 mentions this issue. |
As you have released more major versions with the correct behavior, I think that argument is a little bit thin. An error is more visible than a note in the doc. |
The new behavior is backward compatible with the old behavior, but not vice versa. We take compatibility very seriously, and cannot make backward incompatible changes without a very good reason. I don't think this meets the bar. |
Document the subtle property that files with equivalent base names will overwrite extant templates with those same names. Fixes golang/go#14320 Change-Id: Ie9ace1b08e6896ea599836e31582123169aa7a25 Reviewed-on: https://go-review.googlesource.com/21824 Reviewed-by: Rob Pike <r@golang.org>
See the file structure and the example program below.
This caught me by surprise; if this is the intended behavior, it should be made clear in the docs. You should also consider to return an
error
instead of silently doing the wrong thing.The text was updated successfully, but these errors were encountered: