From f152a5e0c714aae888b2fb81d388fe850406a682 Mon Sep 17 00:00:00 2001 From: Marc Tarnutzer Date: Thu, 4 May 2023 23:54:39 +0200 Subject: [PATCH] simplify connection close --- connection.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/connection.go b/connection.go index bc4c1e8..af2c9e3 100644 --- a/connection.go +++ b/connection.go @@ -204,10 +204,5 @@ func (c *Connection) ReadMessage(ctx context.Context) ([]byte, error) { } func (c *Connection) Close() error { - err := c.conn.Close() - if err != nil { - return fmt.Errorf("failed to close connection: %w", err) - } - - return nil + return c.conn.Close() }