mustache icon indicating copy to clipboard operation
mustache copied to clipboard

Add RenderTo() for Rendering to an io.Writer

Open DeedleFake opened this issue 12 years ago • 1 comments

Here's RenderTo() in it's own pull request. I deleted the really old fork I had, but I kept a local backup.

As part of implementing RenderTo() I also added several places in the rendering methods that can cause errors to be returned, specifically when writing to the io.Writer. With just a bytes.Buffer it's not a problem to not check for errors as the documentation says it's always nil, but with an unknown io.Writer I thought it might be better to check.

I also accidentally ran gofmt, so the diff wound up being quite a bit longer than the actual changes to the code, which were fairly minor.

DeedleFake avatar Apr 08 '13 02:04 DeedleFake

It's very hard for me to see the actual diff because of all the whitespace changes. Can you just run 'make format', and send a new pull request? make format just runs:

gofmt -s -tabs=false -tabwidth=4 mustache.go
gofmt -s -tabs=false -tabwidth=4 mustache_test.go

hoisie avatar Apr 08 '13 03:04 hoisie