mirror of
https://github.com/golang/go
synced 2024-09-05 07:54:46 +00:00
doc/go1.19: complete most remaining TODOs
The ones I left behind are almost entirely ones that I see pending CLs for. Also make various fixes to existing text. For #51400. Change-Id: I555e0074c9df82b5bdb345e21a08c8757ca147b4 Reviewed-on: https://go-review.googlesource.com/c/go/+/410814 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Michael Pratt <mpratt@google.com>
This commit is contained in:
parent
2882786bf4
commit
f330a3a987
317
doc/go1.19.html
317
doc/go1.19.html
|
@ -20,12 +20,26 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
</p>
|
||||
|
||||
<h2 id="language">Changes to the language</h2>
|
||||
<p>
|
||||
TODO: complete this section
|
||||
</p>
|
||||
|
||||
<p><!-- https://go.dev/issue/52038 -->
|
||||
TODO: <a href="https://go.dev/issue/52038">https://go.dev/issue/52038</a>: adjust scope of type parameters declared by method receivers
|
||||
There is only one small change to the language,
|
||||
a <a href="https://github.com/golang/go/issues/52038">very small correction</a>
|
||||
to the <a href="/ref/spec#Declarations_and_scope">scope of type parameters in method declarations</a>.
|
||||
Existing programs are unaffected.
|
||||
</p>
|
||||
|
||||
<h2 id="mem">Memory Model</h2>
|
||||
|
||||
<p><!-- https://go.dev/issue/50859 -->
|
||||
The <a href="/ref/mem">Go memory model</a> has been revised to align Go with
|
||||
the memory model used by C, C++, Java, JavaScript, Rust, and Swift.
|
||||
Go only provides sequentially consistent atomics, not any of the more relaxed forms found in other languages.
|
||||
Along with the memory model update,
|
||||
Go 1.19 introduces <a href="#sync/atomic">new types in the <code>sync/atomic</code> package</a>
|
||||
that make it easier to use atomic values, such as
|
||||
<a href="/pkg/sync/atomic/#Int64">atomic.Int64</a>
|
||||
and
|
||||
<a href="/pkg/sync/atomic/#Pointer">atomic.Pointer[T]</a>.
|
||||
</p>
|
||||
|
||||
<h2 id="ports">Ports</h2>
|
||||
|
@ -37,16 +51,34 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
</p>
|
||||
|
||||
<h2 id="tools">Tools</h2>
|
||||
<p>
|
||||
TODO: complete this section, or delete if not needed
|
||||
</p>
|
||||
<p><!-- https://go.dev/issue/47528 -->:
|
||||
TODO: https://go.dev/issue/47528 warn when errors.As target has type *error
|
||||
</p>
|
||||
|
||||
<h3 id="go-doc">Doc Comments</h3>
|
||||
<p><!-- https://go.dev/issue/51082 -->
|
||||
TODO: complete this section.
|
||||
|
||||
<p><!-- https://go.dev/issue/51082 --><!-- CL 384265, CL 397276, CL 397278, CL 397279, CL 397281, CL 397284 -->
|
||||
Go 1.19 adds support for links, lists, and clearer headings in doc comments.
|
||||
As part of this change, <a href="/cmd/gofmt"><code>gofmt</code></a>
|
||||
now reformats doc comments to make their rendered meaning clearer.
|
||||
See “<a href="/doc/comment">Go Doc Comments</a>”
|
||||
for syntax details and descriptions of common mistakes now highlighted by <code>gofmt</code>.
|
||||
As another part of this change, the new package <a href="/pkg/go/doc/comment">go/doc/comment</a>
|
||||
provides parsing and reformatting of doc comments
|
||||
as well as support for rendering them to HTML, Markdown, and text.
|
||||
</p>
|
||||
|
||||
<h3 id="go-unix">New <code>unix</code> build constraint</h4>
|
||||
|
||||
<p><!-- CL 389934 --><!-- https://go.dev/issue/20322 --><!-- https://go.dev/issue/51572 -->
|
||||
The build constraint <code>unix</code> is now recognized
|
||||
in <code>//go:build</code> lines. The constraint is satisfied
|
||||
if the target operating system, also known as <code>GOOS</code>, is
|
||||
a Unix or Unix-like system. For the 1.19 release it is satisfied
|
||||
if <code>GOOS</code> is one of
|
||||
<code>aix</code>, <code>android</code>, <code>darwin</code>,
|
||||
<code>dragonfly</code>, <code>freebsd</code>, <code>hurd</code>,
|
||||
<code>illumos</code>, <code>ios</code>, <code>linux</code>,
|
||||
<code>netbsd</code>, <code>openbsd</code>, or <code>solaris</code>.
|
||||
In future releases the <code>unix</code> constraint may match
|
||||
additional newly supported operating systems.
|
||||
</p>
|
||||
|
||||
<h3 id="go-command">Go command</h3>
|
||||
|
@ -82,21 +114,13 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
and <code>GOGCCFLAGS</code> variables it reports.
|
||||
</p>
|
||||
|
||||
<h3 id="vet">Vet</h3>
|
||||
|
||||
<h4 id="go-unix">New <code>unix</code> build constraint</h4>
|
||||
|
||||
<p><!-- CL 389934 --><!-- https://go.dev/issue/20322 --><!-- https://go.dev/issue/51572 -->
|
||||
The build constraint <code>unix</code> is now recognized
|
||||
in <code>//go:build</code> lines. The constraint is satisfied
|
||||
if the target operating system, also known as <code>GOOS</code>, is
|
||||
a Unix or Unix-like system. For the 1.19 release it is satisfied
|
||||
if <code>GOOS</code> is one of
|
||||
<code>aix</code>, <code>android</code>, <code>darwin</code>,
|
||||
<code>dragonfly</code>, <code>freebsd</code>, <code>hurd</code>,
|
||||
<code>illumos</code>, <code>ios</code>, <code>linux</code>,
|
||||
<code>netbsd</code>, <code>openbsd</code>, or <code>solaris</code>.
|
||||
In future releases the <code>unix</code> constraint may match
|
||||
additional newly supported operating systems.
|
||||
<p><!-- https://go.dev/issue/47528 -->:
|
||||
The <code>vet</code> checker “errorsas” now reports when
|
||||
<a href="/pkg/errors/#As"><code>errors.As</code></a> is called
|
||||
with a second argument of type <code>*error</code>,
|
||||
a common mistake.
|
||||
</p>
|
||||
|
||||
<h2 id="runtime">Runtime</h2>
|
||||
|
@ -149,13 +173,18 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
space on below-average goroutines.
|
||||
</p>
|
||||
|
||||
<p><!-- https://go.dev/issue/46279 --><!-- CL 393354 -->
|
||||
<p><!-- https://go.dev/issue/46279 --><!-- CL 393354 --><!-- CL 392415 -->
|
||||
On Unix operating systems, Go programs that import package
|
||||
<a href="/pkg/os/">os</a> now automatically increase the open file limit
|
||||
(<code>RLIMIT_NOFILE</code>) to the maximum allowed value. Programs that need
|
||||
a lower limit (for compatibility with <code>select</code>, for example) can
|
||||
set the limit back as needed, or lower the hard limit prior to starting the
|
||||
Go program.
|
||||
(<code>RLIMIT_NOFILE</code>) to the maximum allowed value;
|
||||
that is, they change the soft limit to match the hard limit.
|
||||
This corrects artificially low limits set on some systems for compatibility with very old C programs using the
|
||||
<a href="https://en.wikipedia.org/wiki/Select_(Unix)"><i>select</i></a> system call.
|
||||
Go programs are not helped by that limit, and instead even simple programs like <code>gofmt</code>
|
||||
often ran out of file descriptors on such systems when processing many files in parallel.
|
||||
One impact of this change is that Go programs that in turn execute very old C programs in child processes
|
||||
may run those programs with too high a limit.
|
||||
This can be corrected by setting the hard limit before invoking the Go program.
|
||||
</p>
|
||||
|
||||
<p><!-- https://go.dev/issue/51485 --><!-- CL 390421 -->
|
||||
|
@ -174,7 +203,8 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
</p>
|
||||
|
||||
<p><!-- https://go.dev/issue/44853 -->
|
||||
TODO: <a href="https://go.dev/issue/44853">https://go.dev/issue/44853</a>: enable address sanitizer in Go
|
||||
The <a href="/doc/go1.18#go-build-asan">address sanitizer support added in Go 1.18</a>
|
||||
now handles function arguments and global variables more precisely.
|
||||
</p>
|
||||
|
||||
<h2 id="compiler">Compiler</h2>
|
||||
|
@ -218,11 +248,8 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
|
||||
<h2 id="library">Core library</h2>
|
||||
|
||||
<p>
|
||||
TODO: complete this section
|
||||
</p>
|
||||
|
||||
<h3 id="atomic_types">New atomic types</h3>
|
||||
|
||||
<p><!-- https://go.dev/issue/50860 --><!-- CL 381317 -->
|
||||
The <a href="/pkg/sync/atomic/"><code>sync/atomic</code></a> package defines new atomic types
|
||||
<a href="/pkg/sync/atomic/#Bool"><code>Bool</code></a>,
|
||||
|
@ -238,46 +265,46 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
the need to convert to
|
||||
<a href="/pkg/unsafe/#Pointer"><code>unsafe.Pointer</code></a> at call sites.
|
||||
<a href="/pkg/sync/atomic/#Int64"><code>Int64</code></a> and
|
||||
<a href="/pkg/sync/atomic/#Uint64"><code>Uint64</code></a> automatically
|
||||
receive 64-bit alignment on ARM, 386, and 32-bit MIPS required for 64-bit
|
||||
atomics on these systems.
|
||||
</p>
|
||||
|
||||
<h3 id="go/doc/comment">Doc comment parsing</h3>
|
||||
|
||||
<p><!-- CL 384265 --><!-- CL 397276 --><!-- CL 397278 --><!-- CL 397279 --><!-- CL 397281 --><!-- CL 397284 -->
|
||||
TODO: <a href="https://go.dev/cl/384265">https://go.dev/cl/384265</a>: go/doc: use go/doc/comment; modified api/next/51082.txt
|
||||
TODO: <a href="https://go.dev/cl/397276">https://go.dev/cl/397276</a>: go/doc/comment: add data structures; modified api/next/51082.txt
|
||||
TODO: <a href="https://go.dev/cl/397278">https://go.dev/cl/397278</a>: go/doc/comment: add paragraph parsing and test framework; modified api/next/51082.txt
|
||||
TODO: <a href="https://go.dev/cl/397279">https://go.dev/cl/397279</a>: go/doc/comment: add Printer and basic comment printing; modified api/next/51082.txt
|
||||
TODO: <a href="https://go.dev/cl/397281">https://go.dev/cl/397281</a>: go/doc/comment: parse and print doc links; modified api/next/51082.txt
|
||||
TODO: <a href="https://go.dev/cl/397284">https://go.dev/cl/397284</a>: go/doc/comment: parse and print headings; modified api/next/51082.txt
|
||||
<a href="/pkg/sync/atomic/#Uint64"><code>Uint64</code></a> are
|
||||
automatically aligned to 64-bit boundaries in structs and allocated data,
|
||||
even on 32-bit systems.
|
||||
</p>
|
||||
|
||||
<h3 id="os-exec-path">PATH lookups</h3>
|
||||
|
||||
<p><!-- https://go.dev/issue/43724 --><!-- CL 381374 --><!-- CL 403274 -->
|
||||
TODO: <a href="https://go.dev/issue/43724">https://go.dev/issue/43724</a>: return error when PATH lookup would use current directory
|
||||
</p>
|
||||
<p><!-- https://go.dev/issue/43947 -->
|
||||
TODO: <a href="https://go.dev/issue/43947">https://go.dev/issue/43947</a>: on Windows use NeedCurrentDirectoryForExePathW for LookPath behavior
|
||||
<p><!-- https://go.dev/issue/43724 -->
|
||||
<!-- CL 381374 --><!-- CL 403274 -->
|
||||
<a href="/pkg/os/exec/#Command"><code>Command</code></a> and
|
||||
<a href="/pkg/os/exec/#LookPath"><code>LookPath</code></a> no longer
|
||||
allow results from a PATH search to be found relative to the current directory.
|
||||
This removes a <a href="https://go.dev/blog/path-security">common source of security problems</a>
|
||||
but may also break existing programs that depend on using, say, <code>exec.Command("prog")</code>
|
||||
to run a binary named <code>prog</code> (or, on Windows, <code>prog.exe</code>) in the current directory.
|
||||
See the <a href="/pkg/os/exec/"><code>os/exec</code></a> package documentation for
|
||||
information about how best to update such programs.
|
||||
</p>
|
||||
|
||||
<p><!-- https://go.dev/issue/43947 -->
|
||||
On Windows, <code>Command</code> and <code>LookPath</code> now respect the
|
||||
<a href="https://docs.microsoft.com/en-us/windows/win32/api/processenv/nf-processenv-needcurrentdirectoryforexepatha"><code>NoDefaultCurrentDirectoryInExePath</code></a>
|
||||
environment variable, making it possible to disable
|
||||
the default implicit search of “<code>.</code>” in PATH lookups on Windows systems.
|
||||
</p>
|
||||
|
||||
<h3 id="minor_library_changes">Minor changes to the library</h3>
|
||||
<p>
|
||||
As always, there are various minor changes and updates to the library,
|
||||
made with the Go 1 <a href="/doc/go1compat">promise of compatibility</a>
|
||||
in mind.
|
||||
</p>
|
||||
<p>
|
||||
TODO: complete this section
|
||||
There are also various performance improvements, not enumerated here.
|
||||
</p>
|
||||
|
||||
<dl id="archive/zip"><dt><a href="/pkg/archive/zip/">archive/zip</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 387976 -->
|
||||
TODO: <a href="https://go.dev/cl/387976">https://go.dev/cl/387976</a>: permit zip files to have prefixes
|
||||
<a href="/pkg/archive/zip/#Reader"><code>Reader</code></a>
|
||||
now ignores non-ZIP data at the start of a ZIP file, matching most other implementations.
|
||||
This is necessary to read some Java JAR files, among other uses.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- archive/zip -->
|
||||
|
@ -395,19 +422,19 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
<dl id="debug"><dt><a href="/pkg/debug/">debug</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 396735 -->
|
||||
TODO: <a href="https://go.dev/cl/396735">https://go.dev/cl/396735</a>: debug: define ELF relocation for loong64; modified api/next/46229.txt
|
||||
The new <code>EM_LONGARCH</code> and <code>R_LARCH_*</code> constants
|
||||
support the loong64 port.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- debug -->
|
||||
|
||||
<dl id="debug/pe"><dt><a href="/pkg/debug/pe/">debug/pe</a></dt>
|
||||
<dd>
|
||||
<p><!-- https://go.dev/issue/51868 -->
|
||||
TODO: <a href="https://go.dev/issue/51868">https://go.dev/issue/51868</a>: add APIs to support reading COMDAT info for sections
|
||||
</p>
|
||||
|
||||
<p><!-- CL 394534 -->
|
||||
TODO: <a href="https://go.dev/cl/394534">https://go.dev/cl/394534</a>: debug/pe: add APIs for reading section def aux info; modified api/next/51868.txt
|
||||
<p><!-- https://go.dev/issue/51868 --><!-- CL 394534 -->
|
||||
The new <a href="/pkg/debug/pe/#File.COFFSymbolReadSectionDefAux"><code>File.COFFSymbolReadSectionDefAux</code></a>
|
||||
method, which returns a <a href="/pkg/debug/pe/#COFFSymbolAuxFormat5"><code>COFFSymbolAuxFormat5</code></a>,
|
||||
provides access to COMDAT information in PE file sections.
|
||||
These are supported by new <code>IMAGE_COMDAT_*</code> and <code>IMAGE_SCN_*</code> constants.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- debug/pe -->
|
||||
|
@ -415,19 +442,32 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
<dl id="encoding/binary"><dt><a href="/pkg/encoding/binary/">encoding/binary</a></dt>
|
||||
<dd>
|
||||
<p><!-- https://go.dev/issue/50601 --><!-- CL 386017 --><!-- CL 389636 -->
|
||||
TODO: <a href="https://go.dev/cl/386017">https://go.dev/cl/386017</a>: add AppendByteOrder
|
||||
The new interface
|
||||
<a href="/pkg/encoding/binary/#AppendByteOrder"><code>AppendByteOrder</code></a>
|
||||
provides efficient methods for appending a <code>uint16</code>, <code>uint32</code>, or <code>uint64</code>
|
||||
to a byte slice.
|
||||
<a href="/pkg/encoding/binary/#BigEndian"><code>BigEndian</code></a> and
|
||||
<a href="/pkg/encoding/binary/#LittleEndian"><code>LittleEndian</code></a> now implement this interface.
|
||||
</p>
|
||||
<p><!-- https://go.dev/issue/51644 --><!-- CL 400176 -->
|
||||
TODO: <a href="https://go.dev/issue/51644">https://go.dev/issue/51644</a>: add AppendUvarint and AppendVarint
|
||||
Similarly, the new functions
|
||||
<a href="/pkg/encoding/binary/#AppendUvarint"><code>AppendUvarint</code></a> and
|
||||
<a href="/pkg/encoding/binary/#AppendVarint"><code>AppendVarint</code></a>
|
||||
are efficient appending versions of
|
||||
<a href="/pkg/encoding/binary/#PutUvarint"><code>PutUvarint</code></a> and
|
||||
<a href="/pkg/encoding/binary/#PutVarint"><code>PutVarint</code></a>.
|
||||
</p>
|
||||
|
||||
</dd>
|
||||
</dl><!-- encoding/binary -->
|
||||
|
||||
<dl id="encoding/csv"><dt><a href="/pkg/encoding/csv/">encoding/csv</a></dt>
|
||||
<dd>
|
||||
<p><!-- https://go.dev/issue/43401 --><!-- CL 405675 -->
|
||||
TODO: <a href="https://go.dev/cl/405675">https://go.dev/cl/405675</a>: add Reader.InputOffset method
|
||||
The new method
|
||||
<a href="/pkg/encoding/csv/#Reader.InputOffset"><code>Reader.InputOffset</code></a>
|
||||
reports the reader's current input position as a byte offset,
|
||||
analogous to <code>encoding/json</code>'s
|
||||
<a href="/pkg/encoding/json/#Decoder.InputOffset"><code>Decoder.InputOffset</code></a>.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- encoding/csv -->
|
||||
|
@ -435,8 +475,11 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
<dl id="encoding/xml"><dt><a href="/pkg/encoding/xml/">encoding/xml</a></dt>
|
||||
<dd>
|
||||
<p><!-- https://go.dev/issue/45628 --><!-- CL 311270 -->
|
||||
TODO: <a href="https://go.dev/issue/45628">https://go.dev/issue/45628</a>: add Decoder.InputPos
|
||||
TODO: <a href="https://go.dev/cl/311270">https://go.dev/cl/311270</a>: encoding/xml: expose decoder line and column; modified api/next/45628.txt
|
||||
The new method
|
||||
<a href="/pkg/encoding/xml/#Decoder.InputPos"><code>Decoder.InputPos</code></a>
|
||||
reports the reader's current input position as a line and column,
|
||||
analogous to <code>encoding/csv</code>'s
|
||||
<a href="/pkg/encoding/csv/#Decoder.FieldPos"><code>Decoder.FieldPos</code></a>.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- encoding/xml -->
|
||||
|
@ -444,7 +487,14 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
<dl id="flag"><dt><a href="/pkg/flag/">flag</a></dt>
|
||||
<dd>
|
||||
<p><!-- https://go.dev/issue/45754 --><!-- CL 313329 -->
|
||||
TODO: <a href="https://go.dev/cl/313329">https://go.dev/cl/313329</a>: add TextVar function
|
||||
The new function
|
||||
<a href="/pkg/flag/#TextVar"><code>TextVar</code></a>
|
||||
defines a flag with a value implementing
|
||||
<a href="/pkg/encoding/#TextUnmarshaler"><code>encoding.TextUnmarshaler</code></a>,
|
||||
allowing command-line flag variables to have types such as
|
||||
<a href="/pkg/math/big/#Int"><code>big.Int</code></a>,
|
||||
<a href="/pkg/net/netip/#Addr"><code>netip.Addr</code></a>, and
|
||||
<a href="/pkg/time/#Time"><code>time.Time</code></a>.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- flag -->
|
||||
|
@ -452,7 +502,11 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
<dl id="fmt"><dt><a href="/pkg/fmt/">fmt</a></dt>
|
||||
<dd>
|
||||
<p><!-- https://go.dev/issue/47579 --><!-- CL 406177 -->
|
||||
TODO: <a href="https://go.dev/cl/406177">https://go.dev/cl/406177</a>: add Append, Appendln, Appendf
|
||||
The new functions
|
||||
<a href="/pkg/fmt/#Append"><code>Append</code></a>,
|
||||
<a href="/pkg/fmt/#Appendf"><code>Appendf</code></a>, and
|
||||
<a href="/pkg/fmt/#Appendln"><code>Appendln</code></a>
|
||||
append formatted data to byte slices.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- fmt -->
|
||||
|
@ -460,7 +514,9 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
<dl id="go/parser"><dt><a href="/pkg/go/parser/">go/parser</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 403696 -->
|
||||
TODO: <a href="https://go.dev/cl/403696">https://go.dev/cl/403696</a>: parser to accept ~x as unary expression
|
||||
The parser now recognizes <code>~x</code> as a unary expression with operator
|
||||
<a href="/pkg/go/token#TILDE">token.TILDE</a>,
|
||||
allowing better error recovery when a type constraint such as <code>~int</code> is used in an incorrect context.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- go/parser -->
|
||||
|
@ -489,8 +545,14 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
<dl id="hash/maphash"><dt><a href="/pkg/hash/maphash/">hash/maphash</a></dt>
|
||||
<dd>
|
||||
<p><!-- https://go.dev/issue/42710 --><!-- CL 392494 -->
|
||||
TODO: <a href="https://go.dev/cl/392494">https://go.dev/cl/392494</a>: hash/maphash: add Bytes and String; modified api/next/42710.txt
|
||||
TODO: <a href="https://go.dev/issue/42710">https://go.dev/issue/42710</a>: add Bytes and String
|
||||
The new functions
|
||||
<a href="/pkg/hash/maphash/#Bytes"><code>Bytes</code></a>
|
||||
and
|
||||
<a href="/pkg/hash/maphash/#String"><code>String</code></a>
|
||||
provide an efficient way hash a single byte slice or string.
|
||||
They are equivalent to using the more general
|
||||
<a href="/pkg/hash/maphash/#Hash"><code>Hash</code></a>
|
||||
with a single write, but they avoid setup overhead for small inputs.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- hash/maphash -->
|
||||
|
@ -498,8 +560,11 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
<dl id="html/template"><dt><a href="/pkg/html/template/">html/template</a></dt>
|
||||
<dd>
|
||||
<p><!-- https://go.dev/issue/46121 --><!-- CL 389156 -->
|
||||
TODO: <a href="https://go.dev/issue/46121">https://go.dev/issue/46121</a>: make FuncMap an alias for text/template.FuncMap
|
||||
TODO: <a href="https://go.dev/cl/389156">https://go.dev/cl/389156</a>: html/template: make FuncMap a type alias of text/template.FuncMap; modified api/except.txt, api/next/46121.txt
|
||||
The type <a href="/pkg/html/template/#FuncMap"><code>FuncMap</code></a>
|
||||
is now an alias for
|
||||
<code>text/template</code>'s <a href="/pkg/text/template/#FuncMap"><code>FuncMap</code></a>
|
||||
instead of its own named type.
|
||||
This allows writing code that operates on a <code>FuncMap</code> from either setting.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- html/template -->
|
||||
|
@ -507,11 +572,13 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
<dl id="image/draw"><dt><a href="/pkg/image/draw/">image/draw</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 396795 -->
|
||||
<code>Draw</code> with the <code>Src</code> operator preserves
|
||||
<a href="/pkg/image/draw/#Draw"><code>Draw</code></a> with the
|
||||
<a href="/pkg/image/draw/#Src"><code>Src</code></a> operator preserves
|
||||
non-premultiplied-alpha colors when destination and source images are
|
||||
both <code>*image.NRGBA</code> (or both <code>*image.NRGBA64</code>).
|
||||
both <a href="/pkg/image/#NRGBA"><code>image.NRGBA</code></a>
|
||||
or both <a href="/pkg/image/#NRGBA64"><code>image.NRGBA64</code></a>.
|
||||
This reverts a behavior change accidentally introduced by a Go 1.18
|
||||
library optimization, to match the behavior in Go 1.17 and earlier.
|
||||
library optimization; the code now matches the behavior in Go 1.17 and earlier.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- image/draw -->
|
||||
|
@ -519,11 +586,16 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
<dl id="io"><dt><a href="/pkg/io/">io</a></dt>
|
||||
<dd>
|
||||
<p><!-- https://go.dev/issue/51566 --><!-- CL 400236 -->
|
||||
TODO: <a href="https://go.dev/cl/400236">https://go.dev/cl/400236</a>: NopCloser forward WriterTo implementations if the reader supports it
|
||||
<a href="/pkg/io/#NopCloser"><code>NopCloser</code></a>'s result now implements
|
||||
<a href="/pkg/io/#WriterTo"><code>WriterTo</code></a>
|
||||
whenever its input does.
|
||||
</p>
|
||||
|
||||
<p><!-- https://go.dev/issue/50842 -->
|
||||
TODO: <a href="https://go.dev/issue/50842">https://go.dev/issue/50842</a>: implement WriterTo on result of MultiReader
|
||||
<a href="/pkg/io/#MultiReader"><code>MultiReader</code></a>'s result now implements
|
||||
<a href="/pkg/io/#WriterTo"><code>WriterTo</code></a> unconditionally.
|
||||
If any underlying reader does not implement <code>WriterTo</code>,
|
||||
it is simulated appropriately.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- io -->
|
||||
|
@ -539,7 +611,7 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
type <code>text/javascript; charset=utf-8</code>.
|
||||
Applications that expect <code>text/plain</code> on Windows must
|
||||
now explicitly call
|
||||
<a href="/pkg/mime#AddExtensionType"><code>AddExtensionType</code></a>.
|
||||
<a href="/pkg/mime/#AddExtensionType"><code>AddExtensionType</code></a>.
|
||||
</p>
|
||||
</dd>
|
||||
</dl>
|
||||
|
@ -569,6 +641,7 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
package function or method to return an error, while preserving
|
||||
backward compatibility for error messages.
|
||||
</p>
|
||||
|
||||
<p><!-- https://go.dev/issue/33097 --><!-- CL 400654 -->
|
||||
<a href="/pkg/net/#Resolver.PreferGo"><code>Resolver.PreferGo</code></a>
|
||||
is now implemented on Windows and Plan 9. It previously only worked on Unix
|
||||
|
@ -578,6 +651,7 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
possible to write portable programs and be in control of all DNS name lookups
|
||||
when dialing.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
The <code>net</code> package now has initial support for the <code>netgo</code>
|
||||
build tag on Windows. When used, the package uses the Go DNS client (as used
|
||||
|
@ -636,26 +710,17 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
</dd>
|
||||
</dl><!-- net/url -->
|
||||
|
||||
<dl id="os"><dt><a href="/pkg/os/">os</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 392415 -->
|
||||
TODO: <a href="https://go.dev/cl/392415">https://go.dev/cl/392415</a>: raise open file rlimit at startup
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- os -->
|
||||
|
||||
|
||||
<dl id="os/exec"><dt><a href="/pkg/os/exec/">os/exec</a></dt>
|
||||
<dd>
|
||||
<p><!-- https://go.dev/issue/50599 --><!-- CL 401340 -->
|
||||
An <code>exec.Cmd</code> with a non-empty <code>Dir</code> and a
|
||||
nil <code>Env</code> now implicitly sets the <code>PWD</code> environment
|
||||
A <a href="/pkg/os/exec/#Cmd"><code>Cmd</code></a> with a non-empty <code>Dir</code> field
|
||||
and nil <code>Env</code> now implicitly sets the <code>PWD</code> environment
|
||||
variable for the subprocess to match <code>Dir</code>.
|
||||
</p>
|
||||
<p>
|
||||
The new method <code>(*exec.Cmd).Environ</code> reports the
|
||||
The new method <a href="/pkg/os/exec/#Cmd.Environ"><code>Cmd.Environ</code></a> reports the
|
||||
environment that would be used to run the command, including the
|
||||
aforementioned <code>PWD</code> variable.
|
||||
implicitly set <code>PWD</code> variable.
|
||||
</p>
|
||||
</dd>
|
||||
</dl> <!-- os/exec -->
|
||||
|
@ -663,37 +728,36 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
<dl id="reflect"><dt><a href="/pkg/reflect/">reflect</a></dt>
|
||||
<dd>
|
||||
<p><!-- https://go.dev/issue/47066 --><!-- CL 357331 -->
|
||||
The method <a href="/pkg/reflect/#Value.Bytes"><code>Value.Bytes</code></a> now accepts addressable arrays in addition to slices.
|
||||
The method <a href="/pkg/reflect/#Value.Bytes"><code>Value.Bytes</code></a>
|
||||
now accepts addressable arrays in addition to slices.
|
||||
</p>
|
||||
<p><!-- CL 400954 -->
|
||||
The methods <a href="/pkg/reflect/#Value.Len"><code>Value.Len</code></a> and <a href="/pkg/reflect/#Value.Cap"><code>Value.Cap</code></a> now successfully operate on a pointer to an array and return the length of that array, to match what the <a href="https://go.dev/ref/spec#Length_and_capacity">builtin <code>len</code> and <code>cap</code> functions do</a>.
|
||||
The methods <a href="/pkg/reflect/#Value.Len"><code>Value.Len</code></a>
|
||||
and <a href="/pkg/reflect/#Value.Cap"><code>Value.Cap</code></a>
|
||||
now successfully operate on a pointer to an array and return the length of that array,
|
||||
to match what the <a href="https://go.dev/ref/spec#Length_and_capacity">builtin
|
||||
<code>len</code> and <code>cap</code> functions do</a>.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- reflect -->
|
||||
|
||||
<dl id="regexp"><dt><a href="/pkg/regexp/">regexp</a></dt>
|
||||
<dl id="regexp/syntax"><dt><a href="/pkg/regexp/syntax/">regexp/syntax</a></dt>
|
||||
<dd>
|
||||
<p><!-- https://go.dev/issue/51684 --><!-- CL 401076 -->
|
||||
TODO: <a href="https://go.dev/issue/51684">https://go.dev/issue/51684</a>: add ErrNestingDepth error
|
||||
TODO: <a href="https://go.dev/cl/401076">https://go.dev/cl/401076</a>: regexp: change ErrInvalidDepth message to match proposal; modified api/next/51684.txt, api/next/regexpdepth.txt
|
||||
Go 1.18 release candidate 1, Go 1.17.8, and Go 1.16.15 included a security fix
|
||||
to the regular expression parser, making it reject very deeply nested expressions.
|
||||
Because Go patch releases do not introduce new API,
|
||||
the parser returned <a href="/pkg/regexp/syntax/#ErrInternalError"><code>syntax.ErrInternalError</code></a> in this case.
|
||||
Go 1.19 adds a more specific error, <a href="/pkg/regexp/syntax/#ErrNestingDepth"><code>syntax.ErrNestingDepth</code></a>,
|
||||
which the parser now returns instead.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- regexp -->
|
||||
|
||||
<dl id="regexp/syntax"><dt><a href="/pkg/regexp/syntax/">regexp/syntax</a></dt>
|
||||
<dd>
|
||||
<p><!-- CL 384617 --><!-- CL 401854 -->
|
||||
TODO: <a href="https://go.dev/cl/384617">https://go.dev/cl/384617</a>: regexp/syntax: add and use ErrInvalidDepth; modified api/next/regexpdepth.txt
|
||||
TODO: <a href="https://go.dev/cl/401854">https://go.dev/cl/401854</a>: regexp/syntax: rename ErrInvalidDepth to ErrNestingDepth; modified api/next/51684.txt
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- regexp/syntax -->
|
||||
|
||||
|
||||
<dl id="runtime"><dt><a href="/pkg/runtime/">runtime</a></dt>
|
||||
<dd>
|
||||
<p><!-- https://go.dev/issue/51461 -->
|
||||
The <code>GOROOT</code> function now returns the empty string
|
||||
The <a href="/pkg/runtime/#GOROOT"><code>GOROOT</code></a> function now returns the empty string
|
||||
(instead of <code>"go"</code>) when the binary was built with
|
||||
the <code>-trimpath</code> flag set and the <code>GOROOT</code>
|
||||
variable is not set in the process environment.
|
||||
|
@ -797,8 +861,11 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
is faster for several common scenarios.
|
||||
</p>
|
||||
<p><!-- https://go.dev/issue/50340 --><!-- CL 396514 -->
|
||||
TODO: <a href="https://go.dev/issue/50340">https://go.dev/issue/50340</a>: add Find
|
||||
TODO: <a href="https://go.dev/cl/396514">https://go.dev/cl/396514</a>: sort: add Find function; modified api/next/50340.txt
|
||||
The new function
|
||||
<a href="/pkg/sort/#Find">Find</a>
|
||||
is like
|
||||
<a href="/pkg/sort/#Search">Search</a>
|
||||
but often easier to use: it returns an additional boolean reporting whether an equal value was found.
|
||||
</p>
|
||||
</dd>
|
||||
</dd>
|
||||
|
@ -808,8 +875,9 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
<dd>
|
||||
<p><!-- CL 397255 -->
|
||||
<a href="/pkg/strconv/#Quote"><code>Quote</code></a>
|
||||
and related functions now quote the rune 007F as <code>\x7f</code>,
|
||||
not <code>\u007f</code>.
|
||||
and related functions now quote the rune U+007F as <code>\x7f</code>,
|
||||
not <code>\u007f</code>,
|
||||
for consistency with other ASCII values.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- strconv -->
|
||||
|
@ -835,12 +903,17 @@ Do not send CLs removing the interior tags from such phrases.
|
|||
<dl id="time"><dt><a href="/pkg/time/">time</a></dt>
|
||||
<dd>
|
||||
<p><!-- https://go.dev/issue/51414 --><!-- CL 393515 -->
|
||||
TODO: <a href="https://go.dev/cl/393515">https://go.dev/cl/393515</a>: add Duration.Abs
|
||||
TODO: <a href="https://go.dev/issue/51414">https://go.dev/issue/51414</a>: add Duration.Abs
|
||||
The new method
|
||||
<a href="/pkg/time/#Duration.Abs"><code>Duration.Abs</code></a>
|
||||
provides a convenient and safe way to take the absolute value of a duration,
|
||||
converting −2⁶³ to 2⁶³−1.
|
||||
(This boundary case can happen as the result of subtracting a recent time from the zero time.)
|
||||
</p>
|
||||
<p><!-- https://go.dev/issue/50062 --><!-- CL 405374 -->
|
||||
TODO: <a href="https://go.dev/issue/50062">https://go.dev/issue/50062</a>: add Time.ZoneBounds
|
||||
TODO: <a href="https://go.dev/cl/405374">https://go.dev/cl/405374</a>: time: add Time.ZoneBounds; modified api/next/50062.txt
|
||||
The new method
|
||||
<a href="/pkg/time/#Time.ZoneBounds"><code>Time.ZoneBounds</code></a>
|
||||
returns the start and end times of the time zone in effect at a given time.
|
||||
It can be used in a loop to enumerate all the known time zone transitions at a given location.
|
||||
</p>
|
||||
</dd>
|
||||
</dl><!-- time -->
|
||||
|
|
Loading…
Reference in a new issue