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

Errors ignored #60

Open
shaneHowearth opened this issue Jan 12, 2024 · 0 comments
Open

Errors ignored #60

shaneHowearth opened this issue Jan 12, 2024 · 0 comments

Comments

@shaneHowearth
Copy link

shaneHowearth commented Jan 12, 2024

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)
                 ^
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant