feat(email_message): encapsulate EmailMessage and Attachment struct with private fields and add constructors #16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Encapsulate EmailMessage and Attachment struct with private fields and add constructors
Fixed vulnerability GO-2024-2887 from package net/[email protected]
Description
This pull request encapsulates the
EmailMessage
andAttachment
structs by making their variables private. It adds getters and setters for these variables and implements customMarshalJSON
andUnmarshalJSON
methods. Additionally, constructors for creatingAttachment
from a filename and content, as well as from a file path, have been added. Atestdata
folder is created for adding test files.This pull request also updates the Go version to 1.22.4 to address the GO-2024-2887 vulnerability found in the
net/netip
package.Checklist
Please ensure the following guidelines are met:
type(scope): description
.Additional Information
EmailMessage
struct by making variables private.EmailMessage
variables.MarshalJSON
andUnmarshalJSON
methods forEmailMessage
.Attachment
struct by making variables private.MarshalJSON
andUnmarshalJSON
methods forAttachment
.Attachment
from filename and content.Attachment
from a file path.testdata
folder for adding test files.net/netip
package.