Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added return error to fileFromReader #161

Merged
merged 2 commits into from
Dec 25, 2023
Merged

Conversation

rami-dabain
Copy link

Not returning an error here causes a panic when sending (Header in File object is a null map).

@wneessen
Copy link
Owner

Thanks for the PR @rami-dabain, that's a good catch.
Can you please also update the msg_test.go file to reflect these changes, otherwise the linter will fail:

msg_test.go:1708:16: Error return value of `m.AttachReader` is not checked (errcheck)
        m.AttachReader("testfile.txt", r)
                      ^
msg_test.go:1848:15: Error return value of `m.EmbedReader` is not checked (errcheck)
        m.EmbedReader("testfile.txt", r)
                     ^
msg_test.go:2850:16: Error return value of `m.AttachReader` is not checked (errcheck)
        m.AttachReader("attachment.txt", bytes.NewBufferString(ts1))
                      ^
msg_test.go:2851:15: Error return value of `m.EmbedReader` is not checked (errcheck)
        m.EmbedReader("embedded.txt", bytes.NewBufferString(ts2))

@wneessen
Copy link
Owner

Appreciated! LGTM! Thanks again for the PR and happy holidays, in case you celebrate!

@codecov-commenter
Copy link

Codecov Report

Attention: 7 lines in your changes are missing coverage. Please review.

Comparison is base (d5b410d) 81.18% compared to head (f445a55) 75.21%.

Files Patch % Lines
msg.go 56.25% 5 Missing and 2 partials ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #161      +/-   ##
==========================================
- Coverage   81.18%   75.21%   -5.98%     
==========================================
  Files          24       24              
  Lines        2068     2074       +6     
==========================================
- Hits         1679     1560     -119     
- Misses        277      407     +130     
+ Partials      112      107       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wneessen wneessen merged commit 6cb8290 into wneessen:main Dec 25, 2023
22 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants