In Go 1.18 net.Error.Temporary was deprecated (see
https://go.dev/issue/45729). However, in trying to remove it from my
code, I found one way in which Temporary is used for which there is no
obvious replacement: in a TCP server's Accept loop, when deciding
whether to wait and retry an Accept error.

You can see an example of this in net/http.Server today:
https://github.com/golang/go/blob/ab9d31da9e088a271e656120a3d99cd3b1103ab6/src/net/http/server.go#L3047-L3059

In this case, Temporary seems useful, and enumerating the OS-specific
errors myself doesn't seem like a good idea.

Does anyone have a good solution here? It doesn't seem like this was
adequately considered when making this deprecation decision.

Caleb

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAGeFq%2BkrZLpE0zaL80B-SJsUMx4FeSEOCRrY4fVX1cBsgzRkNg%40mail.gmail.com.

Reply via email to