aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2022-03-30 17:26:21 -0700
committerIan Lance Taylor <iant@golang.org>2022-04-03 15:43:15 +0000
commit85b5f86584686677c554b2538a7edee96d684aea (patch)
tree2a9dec6e9b16ebecbbfd4791ea6dc100d913a0ec /doc
parent73a81d84b644da13bb11ce2e63d7f61041f7ebac (diff)
downloadgo-85b5f86584686677c554b2538a7edee96d684aea.tar.gz
go-85b5f86584686677c554b2538a7edee96d684aea.zip
net: support error.Is of network errors and context errors
Change timeouts to be Is(context.DeadlineExceeded) and cancelation to be Is(context.Canceled). Fixes #51428 Change-Id: Ic580bd9da0f338e993fb79138875a78d99cc1a1d Reviewed-on: https://go-review.googlesource.com/c/go/+/396877 Trust: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/go1.19.html12
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/go1.19.html b/doc/go1.19.html
index cfeb3d3d794..857d8ed8cee 100644
--- a/doc/go1.19.html
+++ b/doc/go1.19.html
@@ -89,6 +89,18 @@ Do not send CLs removing the interior tags from such phrases.
Please report any such problems on <a href="/issue/new">the
issue tracker</a>.
</p>
+
+ <p><!-- CL 396877 -->
+ When a net package function or method returns an "I/O timeout"
+ error, the error will now satisfy <code>errors.Is(err,
+ context.Canceled)</code>. When a net package function returns
+ an "operation was canceled" error, the error will now satisfy
+ <code>errors.Is(err, context.DeadlineExceeded)</code>.
+ These changes are intended to make it easier for code to test
+ for cases in which a context cancelation or timeout causes a net
+ package function or method to return an error, while preserving
+ backward compatibility for error messages.
+ </p>
</dd>
</dl><!-- net -->