Skip to content

Commit 6e248b8

Browse files
ianlancetaylorgopherbot
authored andcommitted
doc/go1.21: mention os package changes
Also mention WTF-8 support in the syscall package. For #32558 For #58977 For #59971 Change-Id: Id1627889b5e498add498748d9bfc69fb58030b35 Reviewed-on: https://go-review.googlesource.com/c/go/+/498600 Reviewed-by: Eli Bendersky <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]> Auto-Submit: Ian Lance Taylor <[email protected]> Run-TryBot: Ian Lance Taylor <[email protected]>
1 parent c2bb350 commit 6e248b8

File tree

1 file changed

+24
-17
lines changed

1 file changed

+24
-17
lines changed

doc/go1.21.html

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -608,38 +608,34 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
608608

609609
<dl id="os"><dt><a href="/pkg/os/">os</a></dt>
610610
<dd>
611+
<p><!-- https://go.dev/issue/32558, CL 219638 -->
612+
Programs may now pass an empty <code>time.Time</code> value to
613+
the <a href="/pkg/os/#Chtimes"><code>Chtimes</code></a> function
614+
to leave either the access time or the modification time unchanged.
615+
</p>
616+
611617
<p><!-- CL 480135 -->
612618
On Windows the
613619
<a href="/pkg/os#File.Chdir"><code>File.Chdir></a> method
614620
now changes the current directory to the file, rather than
615621
always returning an error.
616622
</p>
617623

618-
<p><!-- https://go.dev/issue/32558 -->
619-
TODO: <a href="https://go.dev/issue/32558">https://go.dev/issue/32558</a>: allow Chtimes with time.Time{} to avoid setting time
620-
</p>
621-
622-
<p><!-- CL 219638 -->
623-
TODO: <a href="https://go.dev/cl/219638">https://go.dev/cl/219638</a>: os: make Chtimes accept empty time values to skip file time modification
624-
</p>
625-
626624
<p><!-- CL 477215 -->
627-
TODO: <a href="https://go.dev/cl/477215">https://go.dev/cl/477215</a>: os: avoid creating a new file in Truncate on Windows; os.Truncate on Windows no longer now fails if the file does not exist, consistent with other platforms
625+
On Windows calling
626+
<a href="/pkg/os/#Truncate"><code>Truncate</code></a> on a
627+
non-existent file used to create an empty file. It now returns
628+
an error indicating that the file does not exist.
628629
</p>
629630

630631
<p><!-- CL 493036 -->
631-
TODO: <a href="https://go.dev/cl/493036">https://go.dev/cl/493036</a>: os, syscall: support ill-formed UTF-16 strings on Windows
632+
On Windows the os package now supports working with files whose
633+
names, stored as UTF-16, can't be represented as valid UTF-8.
632634
</p>
633635
</dd>
634636
</dl><!-- os -->
635637

636-
<dl id="os/user"><dt><a href="/pkg/os/user/">os/user</a></dt>
637-
<dd>
638-
<p><!-- CL 459455 -->
639-
TODO: <a href="https://go.dev/cl/459455">https://go.dev/cl/459455</a>: os/user: lookup Linux users and groups via systemd userdb
640-
</p>
641-
</dd>
642-
</dl><!-- os/user -->
638+
<!-- CL 459455 reverted -->
643639

644640
<dl id="reflect"><dt><a href="/pkg/reflect/">reflect</a></dt>
645641
<dd>
@@ -792,6 +788,17 @@ <h3 id="minor_library_changes">Minor changes to the library</h3>
792788
has a new field <code>Jail</code> that may be used to put the
793789
newly created process in a jailed environment.
794790
</p>
791+
792+
<p><!-- CL 493036 -->
793+
On Windows the syscall package now supports working with files whose
794+
names, stored as UTF-16, can't be represented as valid UTF-8.
795+
The <a href="/pkg/syscall#UTF16ToString"><code>UTF16ToString</code></a>
796+
and <a href="/pkg/syscall#UTF16FromString"><code>UTF16FromString</code></a>
797+
functions now convert between UTF-16 data and
798+
<a href=http://simonsapin.github.io/wtf-8/"">WTF-8</a> strings.
799+
This is backward compatible as WTF-8 is a superset of the UTF-8
800+
format that was used in earlier releases.
801+
</p>
795802
</dd>
796803
</dl><!-- syscall -->
797804

0 commit comments

Comments
 (0)