Skip to content

Commit

Permalink
Updated mail.Address initialization in tests to make golangci-lint happy
Browse files Browse the repository at this point in the history
Tests for new mail address handling methods have been updated to use {Name:"", Address: "[email protected]"} format for initializing the []*mail.Address slices, instead of the previous shorthand {"", "[email protected]"}. This was done to increase code clarity and explicitness.
  • Loading branch information
wneessen committed Nov 10, 2023
1 parent cc14864 commit 43c26a3
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions msg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2947,22 +2947,22 @@ func TestMsg_ToFromString(t *testing.T) {
sf bool
}{
{"valid single address", "[email protected]", []*mail.Address{
{"", "[email protected]"},
{Name: "", Address: "[email protected]"},
}, false},
{
"valid multiple addresses", "[email protected],[email protected]",
[]*mail.Address{
{"", "[email protected]"},
{"", "[email protected]"},
{Name: "", Address: "[email protected]"},
{Name: "", Address: "[email protected]"},
},
false,
},
{
"valid multiple addresses with space and name",
`[email protected], "Toni Tester" <[email protected]>`,
[]*mail.Address{
{"", "[email protected]"},
{"Toni Tester", "[email protected]"},
{Name: "", Address: "[email protected]"},
{Name: "Toni Tester", Address: "[email protected]"},
},
false,
},
Expand Down Expand Up @@ -3006,22 +3006,22 @@ func TestMsg_CcFromString(t *testing.T) {
sf bool
}{
{"valid single address", "[email protected]", []*mail.Address{
{"", "[email protected]"},
{Name: "", Address: "[email protected]"},
}, false},
{
"valid multiple addresses", "[email protected],[email protected]",
[]*mail.Address{
{"", "[email protected]"},
{"", "[email protected]"},
{Name: "", Address: "[email protected]"},
{Name: "", Address: "[email protected]"},
},
false,
},
{
"valid multiple addresses with space and name",
`[email protected], "Toni Tester" <[email protected]>`,
[]*mail.Address{
{"", "[email protected]"},
{"Toni Tester", "[email protected]"},
{Name: "", Address: "[email protected]"},
{Name: "Toni Tester", Address: "[email protected]"},
},
false,
},
Expand Down Expand Up @@ -3065,22 +3065,22 @@ func TestMsg_BccFromString(t *testing.T) {
sf bool
}{
{"valid single address", "[email protected]", []*mail.Address{
{"", "[email protected]"},
{Name: "", Address: "[email protected]"},
}, false},
{
"valid multiple addresses", "[email protected],[email protected]",
[]*mail.Address{
{"", "[email protected]"},
{"", "[email protected]"},
{Name: "", Address: "[email protected]"},
{Name: "", Address: "[email protected]"},
},
false,
},
{
"valid multiple addresses with space and name",
`[email protected], "Toni Tester" <[email protected]>`,
[]*mail.Address{
{"", "[email protected]"},
{"Toni Tester", "[email protected]"},
{Name: "", Address: "[email protected]"},
{Name: "Toni Tester", Address: "[email protected]"},
},
false,
},
Expand Down

0 comments on commit 43c26a3

Please sign in to comment.