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

implement io.ReaderFrom for gin.ResponseWriter #3197

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

Commits on Jun 13, 2022

  1. implement io.ReaderFrom for gin.ResponseWriter

    This causes io.Copy, which calls io.copyBuffer, to automatically use the
    sendfile syscall by calling the underlying http.ResponseWriter's
    ReadFrom implementation [1]. This can be a significant performance improvement.
    
    [1] https://github.com/golang/go/blob/7eeec1f6e4/src/io/io.go#L410-L413
    
    Co-authored-by: Alex Guerra <alex@heyimalex.com>
    aaronjanse and heyimalex committed Jun 13, 2022
    Copy the full SHA
    fdb1c44 View commit details
    Browse the repository at this point in the history