From 9ea1a47c1cab401adb81dc4e564fe6760c555bb7 Mon Sep 17 00:00:00 2001 From: "fox.cpp" <fox.cpp@disroot.org> Date: Sat, 28 Aug 2021 15:26:59 +0300 Subject: [PATCH] tests: Change Conn.Expect to not return an error To get rid of a bunch of "error value is not checked" warnings. --- tests/conn.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/conn.go b/tests/conn.go index 80fe750..9ff86e8 100644 --- a/tests/conn.go +++ b/tests/conn.go @@ -111,18 +111,17 @@ func (c *Conn) Readln() (string, error) { return c.Scanner.Text(), nil } -func (c *Conn) Expect(line string) error { +func (c *Conn) Expect(line string) { c.T.Helper() actual, err := c.Readln() if err != nil { - return err + c.T.Fatal("Unexpected I/O error:", err) } if line != actual { c.T.Fatalf("Response line not matching the expected one, want %q", line) } - return nil } // ExpectPattern reads a line from the connection socket and checks whether is