From: Damien Neil Date: Fri, 6 Aug 2021 17:33:08 +0000 (-0700) Subject: net: deprecate (net.Error).Temporary X-Git-Tag: go1.18beta1~1402 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=a53e3d5f885ca7a0df1cd6cf65faa5b63a802dce;p=gostls13.git net: deprecate (net.Error).Temporary Fixes #45729. Change-Id: I819dd0cc79fc23baac46cafd78bb80f5133c992b Reviewed-on: https://go-review.googlesource.com/c/go/+/340261 Trust: Damien Neil Trust: Bryan C. Mills Run-TryBot: Damien Neil TryBot-Result: Go Bot Reviewed-by: Ian Lance Taylor --- diff --git a/src/net/net.go b/src/net/net.go index a7c65fff79..ab6aeaac2f 100644 --- a/src/net/net.go +++ b/src/net/net.go @@ -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.