Skip to content
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

benchstat: accept io.Writer in FormatHTML, not *bytes.Buffer #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Dec 14, 2019

  1. benchstat: accept io.Writer in FormatHTML, not *bytes.Buffer

    This brings the API in-line with that of FormatText and FormatCSV and
    allows it to be used without necessitating an intermediate buffer. The
    change is fully backwards compatible and doesn't impose any potential
    performance cost because `html.Template.Execute` accepts an io.Writer,
    so any `bytes.Buffer` passed by reference to FormatHTML was already
    being forced to escape onto the heap.
    
    This might have been done this way to avoid questions about how the
    function should handle errors from Writer, but we already ignore those
    questions and panic in `FormatCSV`, so it seems reasonable that we would
    do the same thing here.
    nvanbenschoten committed Dec 14, 2019
    Configuration menu
    Copy the full SHA
    c5a59e8 View commit details
    Browse the repository at this point in the history