mirror of
https://github.com/moby/moby.git
synced 2025-07-29 07:21:35 +03:00
Replace errors.Cause() with errors.Is() / errors.As()
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@ -207,8 +207,9 @@ func (s *DockerSuite) TestPostContainersAttach(c *testing.T) {
|
||||
assert.NilError(c, err)
|
||||
|
||||
var outBuf, errBuf bytes.Buffer
|
||||
var nErr net.Error
|
||||
_, err = stdcopy.StdCopy(&outBuf, &errBuf, resp.Reader)
|
||||
if err != nil && errors.Cause(err).(net.Error).Timeout() {
|
||||
if errors.As(err, &nErr) && nErr.Timeout() {
|
||||
// ignore the timeout error as it is expected
|
||||
err = nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user