mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-23 22:20:51 +01:00
Compare commits
4 commits
cf87ea68d3
...
02308df4fd
Author | SHA1 | Date | |
---|---|---|---|
02308df4fd | |||
|
09521758db | ||
32a5603496 | |||
b88b67e2c7 |
3 changed files with 19 additions and 1 deletions
2
.github/workflows/sonarqube.yml
vendored
2
.github/workflows/sonarqube.yml
vendored
|
@ -44,7 +44,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
go test -v -race --coverprofile=./cov.out ./...
|
go test -v -race --coverprofile=./cov.out ./...
|
||||||
|
|
||||||
- uses: sonarsource/sonarqube-scan-action@540792c588b5c2740ad2bb4667db5cd46ae678f2 # master
|
- uses: sonarsource/sonarqube-scan-action@aecaf43ae57e412bd97d70ef9ce6076e672fe0a9 # master
|
||||||
env:
|
env:
|
||||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
|
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
|
||||||
|
|
5
msg.go
5
msg.go
|
@ -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
|
||||||
|
|
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
|
// 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)
|
||||||
|
|
Loading…
Reference in a new issue