mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-27 16:17:03 +00:00
Make it explicit when we are intentionally not checking errors
The linter complains that we're not checking for errors, but on some cases it's on code paths were it is reasonable to do so (e.g. we're closing the connection and it's a best-effort write). This patch adjusts the code to make those cases explicit.
This commit is contained in:
@@ -250,7 +250,7 @@ loop:
|
||||
case "AUTH":
|
||||
code, msg = c.AUTH(params)
|
||||
case "QUIT":
|
||||
c.writeResponse(221, "2.0.0 Be seeing you...")
|
||||
_ = c.writeResponse(221, "2.0.0 Be seeing you...")
|
||||
break loop
|
||||
default:
|
||||
// Sanitize it a bit to avoid filling the logs and events with
|
||||
@@ -272,7 +272,7 @@ loop:
|
||||
if errCount > 10 {
|
||||
// https://tools.ietf.org/html/rfc5321#section-4.3.2
|
||||
c.tr.Errorf("too many errors, breaking connection")
|
||||
c.writeResponse(421, "4.5.0 Too many errors, bye")
|
||||
_ = c.writeResponse(421, "4.5.0 Too many errors, bye")
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -1090,9 +1090,9 @@ func (c *Conn) writeResponse(code int, msg string) error {
|
||||
return writeResponse(c.writer, code, msg)
|
||||
}
|
||||
|
||||
func (c *Conn) printfLine(format string, args ...interface{}) error {
|
||||
func (c *Conn) printfLine(format string, args ...interface{}) {
|
||||
fmt.Fprintf(c.writer, format+"\r\n", args...)
|
||||
return c.writer.Flush()
|
||||
c.writer.Flush()
|
||||
}
|
||||
|
||||
// writeResponse writes a multi-line response to the given writer.
|
||||
|
||||
Reference in New Issue
Block a user