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 <github@gone.nl>
This commit is contained in:
parent
3c06ebd876
commit
2cff05e960
|
@ -154,12 +154,10 @@ func (cli *Client) doRequest(ctx context.Context, req *http.Request) (serverResp
|
||||||
if err.Timeout() {
|
if err.Timeout() {
|
||||||
return serverResp, ErrorConnectionFailed(cli.host)
|
return serverResp, ErrorConnectionFailed(cli.host)
|
||||||
}
|
}
|
||||||
if !err.Temporary() {
|
|
||||||
if strings.Contains(err.Error(), "connection refused") || strings.Contains(err.Error(), "dial unix") {
|
if strings.Contains(err.Error(), "connection refused") || strings.Contains(err.Error(), "dial unix") {
|
||||||
return serverResp, ErrorConnectionFailed(cli.host)
|
return serverResp, ErrorConnectionFailed(cli.host)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Although there's not a strongly typed error for this in go-winio,
|
// Although there's not a strongly typed error for this in go-winio,
|
||||||
// lots of people are using the default configuration for the docker
|
// lots of people are using the default configuration for the docker
|
||||||
|
|
Loading…
Reference in New Issue