Skip to content
This repository was archived by the owner on Jul 26, 2024. It is now read-only.

Errors ignored #60

@shaneHowearth

Description

@shaneHowearth

The .golangci.yml file has been configured such that errcheck is disabled/not run, which of course means that errors are ignored in the project.

It's a simple fix to check those errors and slog.Error() if an error is returned by these functions, and I don't think that it will clutter the codebase to include what will be unlikely to happen.

These are the issues currently raised by errcheck

gomail/smtp.go:236:21: Error return value of `c.conn.SetDeadline` is not checked (errcheck)
                c.conn.SetDeadline(time.Now().Add(c.d.Timeout))
                                  ^
gomail/writeto.go:83:17: Error return value of `mw.SetBoundary` is not checked (errcheck)
                mw.SetBoundary(boundary)
                              ^
gomail/writeto.go:300:12: Error return value of `w.w.Write` is not checked (errcheck)
                w.w.Write(p[:maxLineLen-w.lineLen])
                         ^
gomail/writeto.go:301:12: Error return value of `w.w.Write` is not checked (errcheck)
                w.w.Write([]byte("\r\n"))
                         ^
gomail/writeto.go:307:11: Error return value of `w.w.Write` is not checked (errcheck)
        w.w.Write(p)
                 ^

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions