Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
text/template: (also html/template?) document Execute can write to writer before returning an error #7445
What steps will reproduce the problem? If possible, include a link to a program on play.golang.org. 1. create a template with multiple sub-templates (if i got the terminology right) 2. .Execute() it with a writer What is the expected output? If .Execute() returns an error, the expectation is that no output is written. What do you see instead? Depending on how the template is constructed, .Execute() may cause some data to be written before the error is returned. It should be documented that if you require no output to be written in the case of an error, then you should necessarily write out to a temporary buffer and check the error first, and then copy the buffer to it's final destination. Please provide any additional information below. http://play.golang.org/p/1JYAcgouZd