Skip to content

Commit

Permalink
doc/go1.21: mention errors.ErrUnsupported
Browse files Browse the repository at this point in the history
Also mention errors that implement it.

For golang#41198

Change-Id: I4f01b112f53b19e2494b701bb012cb2cb52f8962
Reviewed-on: https://go-review.googlesource.com/c/go/+/498775
Reviewed-by: Eli Bendersky <eliben@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
  • Loading branch information
ianlancetaylor authored and Hiro committed Jun 4, 2023
1 parent e501219 commit dc5001c
Showing 1 changed file with 29 additions and 7 deletions.
36 changes: 29 additions & 7 deletions doc/go1.21.html
Original file line number Diff line number Diff line change
Expand Up @@ -426,12 +426,14 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>

<dl id="errors"><dt><a href="/pkg/errors/">errors</a></dt>
<dd>
<p><!-- https://go.dev/issue/41198 -->
TODO: <a href="https://go.dev/issue/41198">https://go.dev/issue/41198</a>: add ErrUnsupported
</p>

<p><!-- CL 473935 -->
TODO: <a href="https://go.dev/cl/473935">https://go.dev/cl/473935</a>: errors: add ErrUnsupported; modified api/next/41198.txt
<p><!-- https://go.dev/issue/41198, CL 473935 -->
The new
<a href="/pkg/errors/#ErrUnsupported"><code>ErrUnsupported</code></a>
error provides a standardized way to indicate that a requested
operation may not be performed because it is unsupported.
For example, a call to
<a href="/pkg/os/#Link"><code>os.Link</code></a> when using a
file system that does not support hard links.
</p>
</dd>
</dl><!-- errors -->
Expand Down Expand Up @@ -646,7 +648,11 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
</p>

<p><!-- CL 494122 -->
TODO: <a href="https://go.dev/cl/494122">https://go.dev/cl/494122</a>: net/http: let ErrNotSupported match errors.ErrUnsupported; modified api/next/41198.txt
The <a href="/pkg/net/http/">net/http</a> package now supports
<a href="/pkg/errors/#ErrUnsupported"><code>errors.ErrUnsupported</code></a>,
in that the expression
<code>errors.Is(http.ErrNotSupported, errors.ErrUnsupported)</code>
will return true.
</p>
</dd>
</dl><!-- net/http -->
Expand Down Expand Up @@ -828,6 +834,22 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
This is backward compatible as WTF-8 is a superset of the UTF-8
format that was used in earlier releases.
</p>

<p><!-- CL 476578, CL 476875, CL 476916 -->
Several error values match the new
<a href="/pkg/errors/#ErrUnsupported"><code>errors.ErrUnsupported</code></a>,
such that <code>errors.Is(err, errors.ErrUnsupported)</code>
returns true.
<ul>
<li><code>ENOSYS</code></li>
<li><code>ENOTSUP</code></li>
<li><code>EOPNOTSUPP</code></li>
<li><code>EPLAN9</code> (Plan 9 only)</li>
<li><code>ERROR_CALL_NOT_IMPLEMENTED</code> (Windows only)</li>
<li><code>ERROR_NOT_SUPPORTED</code> (Windows only)</li>
<li><code>EWINDOWS</code> (Windows only)</li>
</ul>
</p>
</dd>
</dl><!-- syscall -->

Expand Down

0 comments on commit dc5001c

Please sign in to comment.