mirror of
https://github.com/wneessen/go-mail.git
synced 2024-11-22 13:50:49 +01:00
#119 make golangci-lint happy again
Since we are Go <1.20 compatible, we can't easily combine errors here. The suggested golangci-lint fix will not work neither, since the %w verb can't be used twice. Therefore, for now we will ignore the linting error Closes #119
This commit is contained in:
parent
84bc888344
commit
44dce70c46
1 changed files with 8 additions and 0 deletions
|
@ -86,6 +86,10 @@ func NewClient(conn net.Conn, host string) (*Client, error) {
|
||||||
_, _, err := text.ReadResponse(220)
|
_, _, err := text.ReadResponse(220)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if cerr := text.Close(); cerr != nil {
|
if cerr := text.Close(); cerr != nil {
|
||||||
|
// Since we are being Go <1.20 compatible, we can't combine errorrs and
|
||||||
|
// duplicate %w vers are not suppored. Therefore let's ignore this linting
|
||||||
|
// error for now
|
||||||
|
// nolint:errorlint
|
||||||
return nil, fmt.Errorf("%w, %s", err, cerr)
|
return nil, fmt.Errorf("%w, %s", err, cerr)
|
||||||
}
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -204,6 +208,10 @@ func (c *Client) Auth(a Auth) error {
|
||||||
mech, resp, err := a.Start(&ServerInfo{c.serverName, c.tls, c.auth})
|
mech, resp, err := a.Start(&ServerInfo{c.serverName, c.tls, c.auth})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if qerr := c.Quit(); qerr != nil {
|
if qerr := c.Quit(); qerr != nil {
|
||||||
|
// Since we are being Go <1.20 compatible, we can't combine errorrs and
|
||||||
|
// duplicate %w vers are not suppored. Therefore let's ignore this linting
|
||||||
|
// error for now
|
||||||
|
// nolint:errorlint
|
||||||
return fmt.Errorf("%w, %s", err, qerr)
|
return fmt.Errorf("%w, %s", err, qerr)
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in a new issue