From 5ad676a7ce1800c7dd6e4f97a6eae52e54f74ef1 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Fri, 26 May 2023 16:22:24 -0700 Subject: [PATCH] doc/go1.21: mention errors.ErrUnsupported Also mention errors that implement it. For #41198 Change-Id: I4f01b112f53b19e2494b701bb012cb2cb52f8962 Reviewed-on: https://go-review.googlesource.com/c/go/+/498775 Reviewed-by: Eli Bendersky Auto-Submit: Ian Lance Taylor Reviewed-by: Ian Lance Taylor Run-TryBot: Ian Lance Taylor Reviewed-by: Michael Knyszek TryBot-Result: Gopher Robot Run-TryBot: Ian Lance Taylor --- doc/go1.21.html | 36 +++++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 7 deletions(-) diff --git a/doc/go1.21.html b/doc/go1.21.html index 0be1bdce5f6d78..2de104219e0aac 100644 --- a/doc/go1.21.html +++ b/doc/go1.21.html @@ -426,12 +426,14 @@

Minor changes to the library

errors
-

- TODO: https://go.dev/issue/41198: add ErrUnsupported -

- -

- TODO: https://go.dev/cl/473935: errors: add ErrUnsupported; modified api/next/41198.txt +

+ The new + ErrUnsupported + error provides a standardized way to indicate that a requested + operation may not be performed because it is unsupported. + For example, a call to + os.Link when using a + file system that does not support hard links.

@@ -646,7 +648,11 @@

Minor changes to the library

- TODO: https://go.dev/cl/494122: net/http: let ErrNotSupported match errors.ErrUnsupported; modified api/next/41198.txt + The net/http package now supports + errors.ErrUnsupported, + in that the expression + errors.Is(http.ErrNotSupported, errors.ErrUnsupported) + will return true.

@@ -828,6 +834,22 @@

Minor changes to the library

This is backward compatible as WTF-8 is a superset of the UTF-8 format that was used in earlier releases.

+ +

+ Several error values match the new + errors.ErrUnsupported, + such that errors.Is(err, errors.ErrUnsupported) + returns true. +

    +
  • ENOSYS
  • +
  • ENOTSUP
  • +
  • EOPNOTSUPP
  • +
  • EPLAN9 (Plan 9 only)
  • +
  • ERROR_CALL_NOT_IMPLEMENTED (Windows only)
  • +
  • ERROR_NOT_SUPPORTED (Windows only)
  • +
  • EWINDOWS (Windows only)
  • +
+