Fix linter errors

Replaced `err == io.EOF` with `errors.Is(err, io.EOF)` for better error comparison. Removed redundant `break` statements to streamline case logic and improve code readability.
This commit is contained in:
Winni Neessen 2024-09-20 15:58:51 +02:00
parent 482194b4b3
commit 157c138142
Signed by: wneessen
GPG key ID: 385AC9889632126E

View file

@ -2097,7 +2097,7 @@ func handleTestServerConnection(connection net.Conn, featureSet string, failRese
for {
data, err = reader.ReadString('\n')
if err != nil {
if err == io.EOF {
if errors.Is(err, io.EOF) {
break
}
fmt.Println("Error reading data:", err)
@ -2158,17 +2158,14 @@ func handleTestServerConnection(connection net.Conn, featureSet string, failRese
case strings.EqualFold(data, "noop"),
strings.EqualFold(data, "vrfy"):
writeOK()
break
case strings.EqualFold(data, "rset"):
if failReset {
_ = writeLine("500 5.1.2 Error: reset failed")
break
}
writeOK()
break
case strings.EqualFold(data, "quit"):
_ = writeLine("221 2.0.0 Bye")
break
default:
_ = writeLine("500 5.5.2 Error: bad syntax")
}