mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-23 14:10:50 +01:00
Compare commits
4 commits
ffdea8337e
...
32a5603496
Author | SHA1 | Date | |
---|---|---|---|
32a5603496 | |||
b88b67e2c7 | |||
cf87ea68d3 | |||
|
ca0d94c7a7 |
4 changed files with 22 additions and 4 deletions
6
.github/workflows/codeql-analysis.yml
vendored
6
.github/workflows/codeql-analysis.yml
vendored
|
@ -54,7 +54,7 @@ jobs:
|
|||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10
|
||||
uses: github/codeql-action/init@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# 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).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
- 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.
|
||||
# 📚 https://git.io/JvXDl
|
||||
|
@ -79,4 +79,4 @@ jobs:
|
|||
# make release
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@23acc5c183826b7a8a97bce3cecc52db901f8251 # v3.25.10
|
||||
uses: github/codeql-action/analyze@b611370bb5703a7efb587f9d136a52ea24c5c38c # v3.25.11
|
||||
|
|
2
.github/workflows/scorecards.yml
vendored
2
.github/workflows/scorecards.yml
vendored
|
@ -75,6 +75,6 @@ jobs:
|
|||
|
||||
# Upload the results to GitHub's code scanning dashboard.
|
||||
- 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:
|
||||
sarif_file: results.sarif
|
||||
|
|
5
msg.go
5
msg.go
|
@ -679,6 +679,11 @@ func (m *Msg) GetAttachments() []*File {
|
|||
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.
|
||||
func (m *Msg) SetAttachements(files []*File) {
|
||||
m.attachments = files
|
||||
|
|
13
msg_test.go
13
msg_test.go
|
@ -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
|
||||
// methods with consecutive calls to Msg.WriteTo to make sure the attachments are not
|
||||
// lost (see Github issue #110)
|
||||
|
|
Loading…
Reference in a new issue