From 2ddda72c349b48d66e04c5759e266de524288b99 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Tue, 23 Jul 2024 19:22:05 +0100 Subject: [PATCH] request: fix error handling in Request --- request.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/request.go b/request.go index 5d2d4c5..6f6b67e 100644 --- a/request.go +++ b/request.go @@ -175,7 +175,7 @@ func (c *RequestClient) Request(request RawRequest) (response RawResponse, err e // Connect to the request socket conn, err := net.DialUnix("unix", nil, c.conn) defer func() { - if e := conn.Close(); e == nil { + if e := conn.Close(); e != nil { err = fmt.Errorf("error while closing socket: %w", e) } }()