• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

go-pkgz / email / 32195276346
93%

Build:
DEFAULT BRANCH: master
Ran 18 Aug 2026 11:00PM UTC
Jobs 1
Files 3
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

18 Aug 2026 11:00PM UTC coverage: 92.819% (-1.3%) from 94.15%
32195276346

push

github

web-flow
Wrap base64 attachments, accept empty files, build the message in one buffer (#28)

* Build the message in a single buffer

Previously, buildMessage assembled the headers into a string, the body into
a separate buffer, joined the two into another string, and Send copied that
into a buffer again. With attachments this held several full copies of the
base64-expanded message at once.

After this change, buildMessage writes everything into one buffer and Send
writes it to the smtp writer directly. The produced message is unchanged.

* Wrap base64 encoded attachments at 76 characters

Previously, the base64 encoder wrote each attachment and inline image as a
single unbroken line, so anything over 57 bytes produced a line longer than
the 76 characters RFC 2045 allows. The test image alone made a line of
116396 characters, and strict relays reject such messages.

After this change, the encoded output goes through a line wrapper which
breaks it into 76 character lines separated by CRLF.

The MIME test helper now decodes the content of leaf parts, so attachment
assertions compare the decoded bytes with the file instead of matching the
encoded blob as a substring.

* Accept empty files as attachments

Previously, an existing but zero-byte file failed the whole message with
"failed to read file type: EOF", because the type detection treated EOF as
fatal. After this change, EOF from the type sniffing read is accepted and
the empty file becomes a valid, empty attachment part.

Content type is now detected from the bytes actually read instead of the
512 byte buffer with the trailing null bytes trimmed off, so a file whose
own content ends with null bytes is sniffed correctly too.

* Add a benchmark for building a message with a large attachment

Building a message with a 4mb attachment takes 21.0mb and 84 allocations,
against 23.8mb and 103 allocations before the single buffer change.

49 of 55 new or added lines in 1 file covered. (89.09%)

2 existing lines in 1 file now uncovered.

349 of 376 relevant lines covered (92.82%)

233.36 hits per line

Uncovered Changes

Lines Coverage ∆ File
6
91.23
-1.55% email.go

Coverage Regressions

Lines Coverage ∆ File
2
91.23
-1.55% email.go
Jobs
ID Job ID Ran Files Coverage
1 32195276346.1 18 Aug 2026 11:00PM UTC 3
92.82
GitHub Action Run
Source Files on build 32195276346
  • Tree
  • List 3
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • b48c2d6e on github
  • Prev Build on master (#32195200143)
  • Next Build on master (#32195979123)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc