From a53e3d5f885ca7a0df1cd6cf65faa5b63a802dce Mon Sep 17 00:00:00 2001 From: Damien Neil Date: Fri, 6 Aug 2021 10:33:08 -0700 Subject: [PATCH] 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 --- src/net/net.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/net/net.go b/src/net/net.go index a7c65fff795..ab6aeaac2f6 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.