Compare commits

..

4 commits

Author SHA1 Message Date
32a5603496
Merge pull request #253 from wneessen/feature/add_get_boundary
Add GetBoundary method and corresponding test
2024-07-02 11:11:33 +02:00
b88b67e2c7
Add GetBoundary method and corresponding test
The GetBoundary method has been added to the Msg struct in msg.go. Alongside this, a corresponding test method, TestMsg_GetBoundary, was introduced in msg_test.go to ensure the proper working of GetBoundary. This new method returns the boundary string of the Msg, which was previously inaccessible.
2024-07-02 10:58:13 +02:00
cf87ea68d3
Merge pull request #252 from wneessen/dependabot/github_actions/github/codeql-action-3.25.11
Bump github/codeql-action from 3.25.10 to 3.25.11
2024-07-01 23:13:35 +02:00
dependabot[bot]
ca0d94c7a7
Bump github/codeql-action from 3.25.10 to 3.25.11
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.10 to 3.25.11.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](23acc5c183...b611370bb5)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-01 13:44:21 +00:00
4 changed files with 22 additions and 4 deletions

View file

@ -54,7 +54,7 @@ jobs:
# Initializes the CodeQL tools for scanning. # Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10 uses: github/codeql-action/init@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
with: with:
languages: ${{ matrix.language }} languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file. # If you wish to specify custom queries, you can do so here or in a config file.
@ -65,7 +65,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below) # If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild - name: Autobuild
uses: github/codeql-action/autobuild@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10 uses: github/codeql-action/autobuild@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
# Command-line programs to run using the OS shell. # Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl # 📚 https://git.io/JvXDl
@ -79,4 +79,4 @@ jobs:
# make release # make release
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10 uses: github/codeql-action/analyze@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11

View file

@ -75,6 +75,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard. # Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning" - name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10 uses: github/codeql-action/upload-sarif@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
with: with:
sarif_file: results.sarif sarif_file: results.sarif

5
msg.go
View file

@ -679,6 +679,11 @@ func (m *Msg) GetAttachments() []*File {
return m.attachments return m.attachments
} }
// GetBoundary returns the boundary of the Msg
func (m *Msg) GetBoundary() string {
return m.boundary
}
// SetAttachements sets the attachements of the message. // SetAttachements sets the attachements of the message.
func (m *Msg) SetAttachements(files []*File) { func (m *Msg) SetAttachements(files []*File) {
m.attachments = files m.attachments = files

View file

@ -2855,6 +2855,19 @@ func TestMsg_GetBccString(t *testing.T) {
} }
} }
// TestMsg_GetBoundary will test the Msg.GetBoundary method
func TestMsg_GetBoundary(t *testing.T) {
b := "random_boundary_string"
m := NewMsg()
if boundary := m.GetBoundary(); boundary != "" {
t.Errorf("GetBoundary failed. Expected empty string, but got: %s", boundary)
}
m = NewMsg(WithBoundary(b))
if boundary := m.GetBoundary(); boundary != b {
t.Errorf("GetBoundary failed. Expected boundary: %s, got: %s", b, boundary)
}
}
// TestMsg_AttachEmbedReader_consecutive tests the Msg.AttachReader and Msg.EmbedReader // TestMsg_AttachEmbedReader_consecutive tests the Msg.AttachReader and Msg.EmbedReader
// methods with consecutive calls to Msg.WriteTo to make sure the attachments are not // methods with consecutive calls to Msg.WriteTo to make sure the attachments are not
// lost (see Github issue #110) // lost (see Github issue #110)