Skip to content

Commit 64e5d38

Browse files
committed
chore: remove unused "error" package
1 parent 8d6c556 commit 64e5d38

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

util/mailer/mailer.go

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ package mailer
33
import (
44
"bytes"
55
"crypto/tls"
6-
"errors"
76
"fmt"
8-
"github.com/semaphoreui/semaphore/pkg/tz"
9-
"github.com/semaphoreui/semaphore/util"
107
"net"
118
"net/smtp"
129
"strings"
1310
"text/template"
1411
"time"
12+
13+
"github.com/semaphoreui/semaphore/pkg/tz"
14+
"github.com/semaphoreui/semaphore/util"
1515
)
1616

1717
const (
@@ -25,14 +25,12 @@ const (
2525
"{{ .Body }}"
2626
)
2727

28-
var (
29-
r = strings.NewReplacer(
30-
"\r\n", "",
31-
"\r", "",
32-
"\n", "",
33-
"%0a", "",
34-
"%0d", "",
35-
)
28+
var r = strings.NewReplacer(
29+
"\r\n", "",
30+
"\r", "",
31+
"\n", "",
32+
"%0a", "",
33+
"%0d", "",
3634
)
3735

3836
func parseTlsVersion(version string) (uint16, error) {
@@ -65,7 +63,6 @@ func Send(
6563
) error {
6664
body := bytes.NewBufferString("")
6765
tpl, err := template.New("").Parse(mailerBase)
68-
6966
if err != nil {
7067
return err
7168
}
@@ -83,7 +80,6 @@ func Send(
8380
Subject: r.Replace(subject),
8481
Body: content,
8582
})
86-
8783
if err != nil {
8884
return err
8985
}
@@ -131,7 +127,7 @@ func plainauth(
131127
body *bytes.Buffer,
132128
) error {
133129
auth := PlainOrLoginAuth(username, password, host)
134-
//auth := smtp.PlainAuth("", username, password, host)
130+
// auth := smtp.PlainAuth("", username, password, host)
135131

136132
return smtp.SendMail(
137133
net.JoinHostPort(host, port),
@@ -220,7 +216,6 @@ func anonymous(
220216
body *bytes.Buffer,
221217
) error {
222218
c, err := smtp.Dial(net.JoinHostPort(host, port))
223-
224219
if err != nil {
225220
return err
226221
}
@@ -236,7 +231,6 @@ func anonymous(
236231
}
237232

238233
w, err := c.Data()
239-
240234
if err != nil {
241235
return err
242236
}

0 commit comments

Comments
 (0)