Skip to content

Instantly share code, notes, and snippets.

@runningzyp
Last active February 9, 2022 09:49
Show Gist options
  • Save runningzyp/f71327ac76f689aab41dcc901043d669 to your computer and use it in GitHub Desktop.
Save runningzyp/f71327ac76f689aab41dcc901043d669 to your computer and use it in GitHub Desktop.
类似 python io.BytesIO
func WriteGZ(path string, Inbytes []byte) []byte {
buf := &bytes.Buffer{}
gzWriter := gzip.NewWriter(buf)
fiWriter := bufio.NewWriter(gzWriter)
fiWriter.Write(Inbytes)
fiWriter.Flush()
gzWriter.Close()
S3.put(outBytes) // useage
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment