]> Cypherpunks repositories - gostls13.git/commitdiff
net: deprecate (net.Error).Temporary
authorDamien Neil <dneil@google.com>
Fri, 6 Aug 2021 17:33:08 +0000 (10:33 -0700)
committerDamien Neil <dneil@google.com>
Thu, 9 Sep 2021 16:32:28 +0000 (16:32 +0000)
Fixes #45729.

Change-Id: I819dd0cc79fc23baac46cafd78bb80f5133c992b
Reviewed-on: https://go-review.googlesource.com/c/go/+/340261
Trust: Damien Neil <dneil@google.com>
Trust: Bryan C. Mills <bcmills@google.com>
Run-TryBot: Damien Neil <dneil@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/net/net.go

index a7c65fff79526d1ce70fef7a96eaafd9ff06dd18..ab6aeaac2f64bb0a71cb16a96375c4843c5712ee 100644 (file)
@@ -396,8 +396,12 @@ type Listener interface {
 // An Error represents a network error.
 type Error interface {
        error
-       Timeout() bool   // Is the error a timeout?
-       Temporary() bool // Is the error temporary?
+       Timeout() bool // Is the error a timeout?
+
+       // Deprecated: Temporary errors are not well-defined.
+       // Most "temporary" errors are timeouts, and the few exceptions are surprising.
+       // Do not use this method.
+       Temporary() bool
 }
 
 // Various errors contained in OpError.