From 157c1381426d5ab6459195b5b169c9e4a1c2e8f4 Mon Sep 17 00:00:00 2001 From: Winni Neessen Date: Fri, 20 Sep 2024 15:58:51 +0200 Subject: [PATCH] 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. --- client_test.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/client_test.go b/client_test.go index bfa799f..afd9cd9 100644 --- a/client_test.go +++ b/client_test.go @@ -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") }