This repository was archived by the owner on Jul 26, 2024. It is now read-only.
forked from go-gomail/gomail
-
Notifications
You must be signed in to change notification settings - Fork 14
Errors ignored #60
Copy link
Copy link
Open
Description
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
Labels
No labels