Created
December 6, 2017 13:19
-
-
Save adrianlungu/992887003466c4da290cc0f917070fbc to your computer and use it in GitHub Desktop.
Golang streaming to http response #02
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for { | |
_, err := io.CopyN(c.Response(), gReader, 4096) | |
if err == io.EOF { | |
c.Response().Flush() | |
break | |
} else if err != nil { | |
return err | |
} | |
c.Response().Flush() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment