From adeb29c64c8fd077756df2598725972d3da4f502 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 31 Jan 2022 15:59:51 +0100 Subject: [PATCH] client/request.go:157:8: SA1019: err.Temporary is deprecated (staticcheck) It's deprecated in Go 1.18: client/request.go:157:8: SA1019: err.Temporary is deprecated: Temporary errors are not well-defined. Most "temporary" errors are timeouts, and the few exceptions are surprising. Do not use this method. (staticcheck) if !err.Temporary() { ^ Signed-off-by: Sebastiaan van Stijn (cherry picked from commit 2cff05e9602dd852879807c7dc0ac50303272cf8) Signed-off-by: Sebastiaan van Stijn --- client/request.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/client/request.go b/client/request.go index f7aebdb2d2..7f54b1dd80 100644 --- a/client/request.go +++ b/client/request.go @@ -150,10 +150,8 @@ func (cli *Client) doRequest(ctx context.Context, req *http.Request) (serverResp if err.Timeout() { return serverResp, ErrorConnectionFailed(cli.host) } - if !err.Temporary() { - if strings.Contains(err.Error(), "connection refused") || strings.Contains(err.Error(), "dial unix") { - return serverResp, ErrorConnectionFailed(cli.host) - } + if strings.Contains(err.Error(), "connection refused") || strings.Contains(err.Error(), "dial unix") { + return serverResp, ErrorConnectionFailed(cli.host) } }