Merge pull request #120 from wneessen/fix/119_golangci-lint-returns-errors

Make golangci-lint happy again
This commit is contained in:
Winni Neessen 2023-03-11 11:08:16 +01:00 committed by GitHub
commit cb9bec4a6f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -86,6 +86,10 @@ func NewClient(conn net.Conn, host string) (*Client, error) {
_, _, err := text.ReadResponse(220)
if err != 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, err
@ -204,6 +208,10 @@ func (c *Client) Auth(a Auth) error {
mech, resp, err := a.Start(&ServerInfo{c.serverName, c.tls, c.auth})
if err != 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 err