Skip to content

Commit 5ad676a

Browse files
ianlancetaylorgopherbot
authored andcommitted
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 <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Reviewed-by: Michael Knyszek <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]>
1 parent 30db6f2 commit 5ad676a

File tree

1 file changed

+29
-7
lines changed

1 file changed

+29
-7
lines changed

doc/go1.21.html

+29-7
Original file line numberDiff line numberDiff line change
@@ -426,12 +426,14 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
426426

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

648650
<p><!-- CL 494122 -->
649-
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
651+
The <a href="/pkg/net/http/">net/http</a> package now supports
652+
<a href="/pkg/errors/#ErrUnsupported"><code>errors.ErrUnsupported</code></a>,
653+
in that the expression
654+
<code>errors.Is(http.ErrNotSupported, errors.ErrUnsupported)</code>
655+
will return true.
650656
</p>
651657
</dd>
652658
</dl><!-- net/http -->
@@ -828,6 +834,22 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
828834
This is backward compatible as WTF-8 is a superset of the UTF-8
829835
format that was used in earlier releases.
830836
</p>
837+
838+
<p><!-- CL 476578, CL 476875, CL 476916 -->
839+
Several error values match the new
840+
<a href="/pkg/errors/#ErrUnsupported"><code>errors.ErrUnsupported</code></a>,
841+
such that <code>errors.Is(err, errors.ErrUnsupported)</code>
842+
returns true.
843+
<ul>
844+
<li><code>ENOSYS</code></li>
845+
<li><code>ENOTSUP</code></li>
846+
<li><code>EOPNOTSUPP</code></li>
847+
<li><code>EPLAN9</code> (Plan 9 only)</li>
848+
<li><code>ERROR_CALL_NOT_IMPLEMENTED</code> (Windows only)</li>
849+
<li><code>ERROR_NOT_SUPPORTED</code> (Windows only)</li>
850+
<li><code>EWINDOWS</code> (Windows only)</li>
851+
</ul>
852+
</p>
831853
</dd>
832854
</dl><!-- syscall -->
833855

0 commit comments

Comments
 (0)