go-email icon indicating copy to clipboard operation
go-email copied to clipboard

Return io.Reader/io.Writer instead of reading everything

Open xeoncross opened this issue 6 years ago • 0 comments

The current code reads the full body in of every part resulting in high memory usage if the email contains big attachments or many instances are running at the same time.

It would be better to build a custom io.Writer buffer or simply return the io.Reader allowing the app to decided to io.Copy, bytes.Buffer, or ReadAll as needed.

xeoncross avatar Apr 10 '18 01:04 xeoncross