Does anyone know how I can open a file, gzip it on the go and send it to a server using a post request?
I have a file that is a reader. Also, I have http.Post() function where I can pass the reader as a 3rd parameter.
But gzip.NewWriter() expects a writer and returns a writer.
I know that I can create some intermediary buffer to connect this all but I don't want to allocate much memory because these files can be quite big. Is there a way to make this pipe and pass it to the HTTP post request?