mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
The infamous "use of closed network connection" error was added in [cl-5649076] as a non-exported error. This made it not possible to write code to handle it as a sentinel error, other than through string- matching. Commit [moby@cc851db] (docker v0.6.4) added a [`IsClosedError`] utility for this (as [net.errClosing@go1.1.2] did not yet export this error). The `IsClosedError` was later moved to the `go-connections` module, but various other places in our code used similar matching. There was a feature-request [go-4373] to export it, which got accepted and implemented in [CL 5649076], so starting with go1.16 we now have [net.ErrClosed@go1.16], so can remove the string matching. [CL 5649076]: https://golang.org/cl/5649076 [moby@cc851db]:cc851dbb3f[`IsClosedError`]:cc851dbb3f/utils/utils.go (L1032-L1040)[net.errClosing@go1.1.2]: https://github.com/golang/go/blob/go1.1.2/src/pkg/net/net.go#L341 [go-4373]: https://github.com/golang/go/issues/4373 [net.ErrClosed@go1.16]: https://github.com/golang/go/blob/go1.16/src/net/net.go#L636-L645 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>