From 2cff05e9602dd852879807c7dc0ac50303272cf8 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 --- client/request.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/client/request.go b/client/request.go index 475ce4bd40..f0fd4e77af 100644 --- a/client/request.go +++ b/client/request.go @@ -154,10 +154,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) } }