mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-22 13:50:49 +01:00
Fix typo / inconsistency for (*Msg).SetAttachments
This commit is contained in:
parent
3e4d8e3acd
commit
7caf0b8e19
2 changed files with 12 additions and 5 deletions
11
msg.go
11
msg.go
|
@ -684,11 +684,18 @@ func (m *Msg) GetBoundary() string {
|
||||||
return m.boundary
|
return m.boundary
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetAttachements sets the attachements of the message.
|
// SetAttachments sets the attachments of the message.
|
||||||
func (m *Msg) SetAttachements(files []*File) {
|
func (m *Msg) SetAttachments(files []*File) {
|
||||||
m.attachments = files
|
m.attachments = files
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetAttachements sets the attachments of the message.
|
||||||
|
//
|
||||||
|
// Deprecated: use SetAttachments instead.
|
||||||
|
func (m *Msg) SetAttachements(files []*File) {
|
||||||
|
m.SetAttachments(files)
|
||||||
|
}
|
||||||
|
|
||||||
// UnsetAllAttachments unset the attachments of the message.
|
// UnsetAllAttachments unset the attachments of the message.
|
||||||
func (m *Msg) UnsetAllAttachments() {
|
func (m *Msg) UnsetAllAttachments() {
|
||||||
m.attachments = nil
|
m.attachments = nil
|
||||||
|
|
|
@ -1413,7 +1413,7 @@ func TestMsg_SetAttachments(t *testing.T) {
|
||||||
for _, f := range tt.files {
|
for _, f := range tt.files {
|
||||||
files = append(files, &File{Name: f})
|
files = append(files, &File{Name: f})
|
||||||
}
|
}
|
||||||
m.SetAttachements(files)
|
m.SetAttachments(files)
|
||||||
if len(m.attachments) != len(files) {
|
if len(m.attachments) != len(files) {
|
||||||
t.Errorf("SetAttachements() failed. Number of attachments expected: %d, got: %d", len(files),
|
t.Errorf("SetAttachements() failed. Number of attachments expected: %d, got: %d", len(files),
|
||||||
len(m.attachments))
|
len(m.attachments))
|
||||||
|
@ -1448,7 +1448,7 @@ func TestMsg_UnsetAllAttachments(t *testing.T) {
|
||||||
for _, f := range tt.attachments {
|
for _, f := range tt.attachments {
|
||||||
files = append(files, &File{Name: f})
|
files = append(files, &File{Name: f})
|
||||||
}
|
}
|
||||||
m.SetAttachements(files)
|
m.SetAttachments(files)
|
||||||
|
|
||||||
if len(m.attachments) != len(files) {
|
if len(m.attachments) != len(files) {
|
||||||
t.Errorf("SetAttachements() failed. Number of attachments expected: %d, got: %d", len(files),
|
t.Errorf("SetAttachements() failed. Number of attachments expected: %d, got: %d", len(files),
|
||||||
|
@ -1610,7 +1610,7 @@ func TestMsg_UnsetAllParts(t *testing.T) {
|
||||||
for _, f := range tt.attachments {
|
for _, f := range tt.attachments {
|
||||||
attachments = append(attachments, &File{Name: f})
|
attachments = append(attachments, &File{Name: f})
|
||||||
}
|
}
|
||||||
m.SetAttachements(attachments)
|
m.SetAttachments(attachments)
|
||||||
if len(m.attachments) != len(attachments) {
|
if len(m.attachments) != len(attachments) {
|
||||||
t.Errorf("SetAttachements() failed. Number of attachments files expected: %d, got: %d",
|
t.Errorf("SetAttachements() failed. Number of attachments files expected: %d, got: %d",
|
||||||
len(attachments), len(m.attachments))
|
len(attachments), len(m.attachments))
|
||||||
|
|
Loading…
Reference in a new issue