1
0
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:
Sebastiaan van Stijn
2020-04-17 12:01:01 +02:00
parent 45369c61a4
commit 07d60bc257
23 changed files with 50 additions and 45 deletions

View File

@ -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
}