mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-22 05:40:50 +01:00
Make golangci-lint happy
Omitting nil redundant nil checks, as len() for []string is defined as zero
This commit is contained in:
parent
5dcbe712ae
commit
6268077b99
1 changed files with 6 additions and 6 deletions
12
msg_test.go
12
msg_test.go
|
@ -1135,7 +1135,7 @@ func TestMsg_RequestMDN(t *testing.T) {
|
|||
if err := m.RequestMDNTo(v); err != nil {
|
||||
t.Errorf("RequestMDNTo with a single valid address failed: %s", err)
|
||||
}
|
||||
if val := m.genHeader[HeaderDispositionNotificationTo]; val != nil && len(val) > 1 {
|
||||
if val := m.genHeader[HeaderDispositionNotificationTo]; len(val) > 1 {
|
||||
if val[0] != fmt.Sprintf("<%s>", v) {
|
||||
t.Errorf("RequestMDNTo with a single valid address failed. Expected: %s, got: %s", v,
|
||||
val[0])
|
||||
|
@ -1147,13 +1147,13 @@ func TestMsg_RequestMDN(t *testing.T) {
|
|||
if err := m.RequestMDNTo(vl...); err != nil {
|
||||
t.Errorf("RequestMDNTo with a multiple valid address failed: %s", err)
|
||||
}
|
||||
if val := m.genHeader[HeaderDispositionNotificationTo]; val != nil && len(val) > 0 {
|
||||
if val := m.genHeader[HeaderDispositionNotificationTo]; len(val) > 0 {
|
||||
if val[0] != fmt.Sprintf("<%s>", v) {
|
||||
t.Errorf("RequestMDNTo with a multiple valid addresses failed. Expected 0: %s, got 0: %s", v,
|
||||
val[0])
|
||||
}
|
||||
}
|
||||
if val := m.genHeader[HeaderDispositionNotificationTo]; val != nil && len(val) > 1 {
|
||||
if val := m.genHeader[HeaderDispositionNotificationTo]; len(val) > 1 {
|
||||
if val[1] != fmt.Sprintf("<%s>", v2) {
|
||||
t.Errorf("RequestMDNTo with a multiple valid addresses failed. Expected 1: %s, got 1: %s", v2,
|
||||
val[1])
|
||||
|
@ -1174,7 +1174,7 @@ func TestMsg_RequestMDN(t *testing.T) {
|
|||
if err := m.RequestMDNAddTo(v2); err != nil {
|
||||
t.Errorf("RequestMDNAddTo with a valid address failed: %s", err)
|
||||
}
|
||||
if val := m.genHeader[HeaderDispositionNotificationTo]; val != nil && len(val) > 1 {
|
||||
if val := m.genHeader[HeaderDispositionNotificationTo]; len(val) > 1 {
|
||||
if val[1] != fmt.Sprintf("<%s>", v2) {
|
||||
t.Errorf("RequestMDNTo with a multiple valid addresses failed. Expected 1: %s, got 1: %s", v2,
|
||||
val[1])
|
||||
|
@ -1186,7 +1186,7 @@ func TestMsg_RequestMDN(t *testing.T) {
|
|||
if err := m.RequestMDNToFormat(n, v); err != nil {
|
||||
t.Errorf("RequestMDNToFormat with a single valid address failed: %s", err)
|
||||
}
|
||||
if val := m.genHeader[HeaderDispositionNotificationTo]; val != nil && len(val) > 0 {
|
||||
if val := m.genHeader[HeaderDispositionNotificationTo]; len(val) > 0 {
|
||||
if val[0] != fmt.Sprintf(`"%s" <%s>`, n, v) {
|
||||
t.Errorf(`RequestMDNToFormat with a single valid address failed. Expected: "%s" <%s>, got: %s`, n, v,
|
||||
val[0])
|
||||
|
@ -1195,7 +1195,7 @@ func TestMsg_RequestMDN(t *testing.T) {
|
|||
if err := m.RequestMDNAddToFormat(n2, v2); err != nil {
|
||||
t.Errorf("RequestMDNAddToFormat with a valid address failed: %s", err)
|
||||
}
|
||||
if val := m.genHeader[HeaderDispositionNotificationTo]; val != nil && len(val) > 1 {
|
||||
if val := m.genHeader[HeaderDispositionNotificationTo]; len(val) > 1 {
|
||||
if val[1] != fmt.Sprintf(`"%s" <%s>`, n2, v2) {
|
||||
t.Errorf(`RequestMDNAddToFormat with a single valid address failed. Expected: "%s" <%s>, got: %s`, n2, v2,
|
||||
val[1])
|
||||
|
|
Loading…
Reference in a new issue