Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
doc/articles/wiki: "Writing Web Applications" example writes the reponse header twice #27789
What version of Go are you using (
This is a valid issue, good catch! Thank you for the well-written report and good analysis.
We should discuss how to resolve it. As you said, one option is to render the template to a
There are other ways to fix this too, and it's important to come up with a solution that makes the most sense in the context of the "Writing Web Applications" tutorial and what the reader is expected to know or be exposed to by then.
/cc @adg as the original author of the article, I believe.
changed the title
wiki: "Writing Web Applications" example writes the reponse header twice
Sep 21, 2018
The only problem with the bytes buffer rendering is that, if the tutorial is going to cover proper error handling, we still run into the same problem down the line.
My suggestion for the tutorial would probably just be to keep writing directly to the
Dunno if there's a simpler solution that I'm missing though.
This is what I came here to say. Template rendering errors are for the application author anyway, not the user, and should typically only happen during development of the program. Logging it here would be ideal, and a couple of sentences explaining this would actually improve the tutorial.