mirror of
https://github.com/golang/go
synced 2024-11-05 18:36:08 +00:00
79bda65041
For #44513 Change-Id: Id4624e977654f7e8c489508a9dce98c9fab621a6 Reviewed-on: https://go-review.googlesource.com/c/go/+/323490 Trust: Ian Lance Taylor <iant@golang.org> Reviewed-by: Rob Pike <r@golang.org>
701 lines
27 KiB
HTML
701 lines
27 KiB
HTML
<!--{
|
|
"Title": "Go 1.17 Release Notes",
|
|
"Path": "/doc/go1.17"
|
|
}-->
|
|
|
|
<!--
|
|
NOTE: In this document and others in this directory, the convention is to
|
|
set fixed-width phrases with non-fixed-width spaces, as in
|
|
<code>hello</code> <code>world</code>.
|
|
Do not send CLs removing the interior tags from such phrases.
|
|
-->
|
|
|
|
<style>
|
|
main ul li { margin: 0.5em 0; }
|
|
</style>
|
|
|
|
<h2 id="introduction">DRAFT RELEASE NOTES — Introduction to Go 1.17</h2>
|
|
|
|
<p>
|
|
<strong>
|
|
Go 1.17 is not yet released. These are work-in-progress
|
|
release notes. Go 1.17 is expected to be released in August 2021.
|
|
</strong>
|
|
</p>
|
|
|
|
<h2 id="language">Changes to the language</h2>
|
|
|
|
<p><!-- CL 216424 -->
|
|
TODO: <a href="https://golang.org/cl/216424">https://golang.org/cl/216424</a>: allow conversion from slice to array ptr
|
|
</p>
|
|
|
|
<p><!-- CL 312212 -->
|
|
TODO: <a href="https://golang.org/cl/312212">https://golang.org/cl/312212</a>: add unsafe.Add and unsafe.Slice
|
|
</p>
|
|
|
|
<h2 id="ports">Ports</h2>
|
|
|
|
<h3 id="darwin">Darwin</h3>
|
|
|
|
<p><!-- golang.org/issue/23011 -->
|
|
As <a href="go1.16#darwin">announced</a> in the Go 1.16 release
|
|
notes, Go 1.17 requires macOS 10.13 High Sierra or later; support
|
|
for previous versions has been discontinued.
|
|
</p>
|
|
|
|
<h3 id="windows">Windows</h3>
|
|
|
|
<p><!-- golang.org/issue/36439 -->
|
|
Go 1.17 adds support of 64-bit ARM architecture on Windows (the
|
|
<code>windows/arm64</code> port). This port supports cgo.
|
|
</p>
|
|
|
|
<h3 id="openbsd">OpenBSD</h3>
|
|
|
|
<p><!-- golang.org/issue/43005 -->
|
|
The 64-bit MIPS architecture on OpenBSD (the <code>openbsd/mips64</code>
|
|
port) now supports cgo.
|
|
</p>
|
|
|
|
<p><!-- golang.org/issue/36435 -->
|
|
In Go 1.16, on the 64-bit x86 and 64-bit ARM architectures on
|
|
OpenBSD (the <code>openbsd/amd64</code> and <code>openbsd/arm64</code>
|
|
ports) system calls are made through <code>libc</code>, instead
|
|
of directly using the machine instructions. In Go 1.17, this is
|
|
also done on the 32-bit x86 and 32-bit ARM architectures on OpenBSD
|
|
(the <code>openbsd/386</code> and <code>openbsd/arm</code> ports).
|
|
This ensures forward-compatibility with future versions of
|
|
OpenBSD.
|
|
</p>
|
|
|
|
<h3 id="arm64">ARM64</h3>
|
|
|
|
<p><!-- CL 288814 -->
|
|
Go programs now maintain stack frame pointers on the 64-bit ARM
|
|
architecture on all operating systems. Previously it maintained
|
|
stack frame pointers only on Linux, macOS, and iOS.
|
|
</p>
|
|
|
|
<p>
|
|
TODO: complete the Ports section
|
|
</p>
|
|
|
|
<h2 id="tools">Tools</h2>
|
|
|
|
<p>
|
|
TODO: complete the Tools section
|
|
</p>
|
|
|
|
<h3 id="go-command">Go command</h3>
|
|
|
|
<h4 id="lazy-loading">Lazy module loading</h4>
|
|
|
|
<p><!-- golang.org/issue/36460 -->
|
|
If a module specifies <code>go</code> <code>1.17</code> or higher in its
|
|
<code>go.mod</code> file, its transitive requirements are now loaded lazily,
|
|
avoiding the need to download or read <code>go.mod</code> files for
|
|
otherwise-irrelevant dependencies. To support lazy loading, in Go 1.17 modules
|
|
the <code>go</code> command maintains <em>explicit</em> requirements in
|
|
the <code>go.mod</code> file for every dependency that provides any package
|
|
transitively imported by any package or test within the module.
|
|
See <a href="https://golang.org/design/36460-lazy-module-loading">the design
|
|
document</a> for more detail.
|
|
<!-- TODO(bcmills): replace the design-doc link with proper documentation. -->
|
|
</p>
|
|
|
|
<p><!-- golang.org/issue/45094 --> To facilitate the upgrade to lazy loading,
|
|
the <code>go</code> <code>mod</code> <code>tidy</code> subcommand now supports
|
|
a <code>-go</code> flag to set or change the <code>go</code> version in
|
|
the <code>go.mod</code> file. To enable lazy loading for an existing module
|
|
without changing the selected versions of its dependencies, run:
|
|
</p>
|
|
|
|
<pre>
|
|
go mod tidy -go=1.17
|
|
</pre>
|
|
|
|
<p><!-- golang.org/issue/46141 -->
|
|
TODO: Describe the <code>-compat</code> flag
|
|
for <code>go</code> <code>mod</code> <code>tidy</code>.
|
|
</p>
|
|
|
|
<h4 id="module-deprecation-comments">Module deprecation comments</h4>
|
|
|
|
<p><!-- golang.org/issue/40357 -->
|
|
Module authors may deprecate a module by adding a
|
|
<a href="/ref/mod#go-mod-file-module-deprecation"><code>// Deprecated:</code>
|
|
comment</a> to <code>go.mod</code>, then tagging a new version.
|
|
<code>go</code> <code>get</code> now prints a warning if a module needed to
|
|
build packages named on the command line is deprecated. <code>go</code>
|
|
<code>list</code> <code>-m</code> <code>-u</code> prints deprecations for all
|
|
dependencies (use <code>-f</code> or <code>-json</code> to show the full
|
|
message). The <code>go</code> command considers different major versions to
|
|
be distinct modules, so this mechanism may be used, for example, to provide
|
|
users with migration instructions for a new major version.
|
|
</p>
|
|
|
|
<h4 id="go-get"><code>go</code> <code>get</code></h4>
|
|
|
|
<p><!-- golang.org/issue/37519 -->
|
|
The <code>go</code> <code>get</code> <code>-insecure</code> flag is
|
|
deprecated and has been removed. To permit the use of insecure schemes
|
|
when fetching dependencies, please use the <code>GOINSECURE</code>
|
|
environment variable. The <code>-insecure</code> flag also bypassed module
|
|
sum validation, use <code>GOPRIVATE</code> or <code>GONOSUMDB</code> if
|
|
you need that functionality. See <code>go</code> <code>help</code>
|
|
<code>environment</code> for details.
|
|
</p>
|
|
|
|
<h4 id="missing-go-directive"><code>go.mod</code> files missing <code>go</code> directives</h4>
|
|
|
|
<p><!-- golang.org/issue/44976 -->
|
|
If the main module's <code>go.mod</code> file does not contain
|
|
a <a href="/doc/modules/gomod-ref#go"><code>go</code> directive</a> and
|
|
the <code>go</code> command cannot update the <code>go.mod</code> file, the
|
|
<code>go</code> command now assumes <code>go 1.11</code> instead of the
|
|
current release. (<code>go</code> <code>mod</code> <code>init</code> has added
|
|
<code>go</code> directives automatically <a href="/doc/go1.12#modules">since
|
|
Go 1.12</a>.)
|
|
</p>
|
|
|
|
<p><!-- golang.org/issue/44976 -->
|
|
If a module dependency lacks an explicit <code>go.mod</code> file, or
|
|
its <code>go.mod</code> file does not contain
|
|
a <a href="/doc/modules/gomod-ref#go"><code>go</code> directive</a>,
|
|
the <code>go</code> command now assumes <code>go 1.16</code> for that
|
|
dependency instead of the current release. (Dependencies developed in GOPATH
|
|
mode may lack a <code>go.mod</code> file, and
|
|
the <code>vendor/modules.txt</code> has to date never recorded
|
|
the <code>go</code> versions indicated by dependencies' <code>go.mod</code>
|
|
files.)
|
|
</p>
|
|
|
|
<h4 id="vendor"><code>vendor</code> contents</h4>
|
|
|
|
<p><!-- golang.org/issue/36876 -->
|
|
If the main module specifies <code>go</code> <code>1.17</code> or higher,
|
|
<code>go</code> <code>mod</code> <code>vendor</code> now annotates
|
|
<code>vendor/modules.txt</code> with the <code>go</code> version indicated by
|
|
each vendored module in its own <code>go.mod</code> file. The annotated
|
|
version is used when building the module's packages from vendored source code.
|
|
</p>
|
|
|
|
<p><!-- golang.org/issue/42970 -->
|
|
If the main module specifies <code>go</code> <code>1.17</code> or higher,
|
|
<code>go</code> <code>mod</code> <code>vendor</code> now omits <code>go.mod</code>
|
|
and <code>go.sum</code> files for vendored dependencies, which can otherwise
|
|
interfere with the ability of the <code>go</code> command to identify the correct
|
|
module root when invoked within the <code>vendor</code> tree.
|
|
</p>
|
|
|
|
<h4 id="password-prompts">Password prompts</h4>
|
|
|
|
<p><!-- golang.org/issue/44904 -->
|
|
The <code>go</code> command by default now suppresses SSH password prompts and
|
|
Git Credential Manager prompts when fetching Git repositories using SSH, as it
|
|
already did previously for other Git password prompts. Users authenticating to
|
|
private Git repos with password-protected SSH may configure
|
|
an <code>ssh-agent</code> to enable the <code>go</code> command to use
|
|
password-protected SSH keys.
|
|
</p>
|
|
|
|
<h4 id="go-mod-download"><code>go</code> <code>mod</code> <code>download</code></h4>
|
|
|
|
<p><!-- golang.org/issue/45332 -->
|
|
When <code>go</code> <code>mod</code> <code>download</code> is invoked without
|
|
arguments, it will no longer save sums for downloaded module content to
|
|
<code>go.sum</code>. It may still make changes to <code>go.mod</code> and
|
|
<code>go.sum</code> needed to load the build list. This is the same as the
|
|
behavior in Go 1.15. To save sums for all modules, use <code>go</code>
|
|
<code>mod</code> <code>download</code> <code>all</code>.
|
|
</p>
|
|
|
|
<p><!-- CL 249759 -->
|
|
TODO: <a href="https://golang.org/cl/249759">https://golang.org/cl/249759</a>: cmd/cover: replace code using optimized golang.org/x/tools/cover
|
|
</p>
|
|
|
|
<h3 id="vet">Vet</h3>
|
|
|
|
<p><!-- CL 299532 -->
|
|
TODO: <a href="https://golang.org/cl/299532">https://golang.org/cl/299532</a>: cmd/vet: bring in sigchanyzer to report unbuffered channels to signal.Notify
|
|
</p>
|
|
|
|
<p>
|
|
TODO: complete the Vet section
|
|
</p>
|
|
|
|
<h2 id="runtime">Runtime</h2>
|
|
|
|
<p><!-- CL 304470 -->
|
|
TODO: <a href="https://golang.org/cl/304470">https://golang.org/cl/304470</a>: cmd/compile, runtime: add metadata for argument printing in traceback
|
|
</p>
|
|
|
|
<p>
|
|
TODO: complete the Runtime section
|
|
</p>
|
|
|
|
<h2 id="compiler">Compiler</h2>
|
|
|
|
<p><!-- CL 283112, golang.org/issue/28727 -->
|
|
|
|
Functions containing closures can now be inlined. One effect of this change is
|
|
that a function with a closure may actually produce a distinct closure function
|
|
for each place that the function is inlined. Hence, this change could reveal
|
|
bugs where Go functions are compared (incorrectly) by pointer value. Go
|
|
functions are by definition not comparable.
|
|
|
|
TODO: complete the Compiler section, or delete if not needed
|
|
</p>
|
|
|
|
<h2 id="linker">Linker</h2>
|
|
|
|
<p>
|
|
TODO: complete the Linker section, or delete if not needed
|
|
</p>
|
|
|
|
<h2 id="library">Core library</h2>
|
|
|
|
<p>
|
|
TODO: complete the Core library section
|
|
</p>
|
|
|
|
<h3 id="crypto/tls"><a href="/pkg/crypto/tls">crypto/tls</a></h3>
|
|
|
|
<p><!-- CL 295370 -->
|
|
<a href="/pkg/crypto/tls#Conn.HandshakeContext">(*Conn).HandshakeContext</a> was added to
|
|
allow the user to control cancellation of an in-progress TLS Handshake.
|
|
The context provided is propagated into the
|
|
<a href="/pkg/crypto/tls#ClientHelloInfo">ClientHelloInfo</a>
|
|
and <a href="/pkg/crypto/tls#CertificateRequestInfo">CertificateRequestInfo</a>
|
|
structs and accessible through the new
|
|
<a href="/pkg/crypto/tls#ClientHelloInfo.Context">(*ClientHelloInfo).Context</a>
|
|
and
|
|
<a href="/pkg/crypto/tls#CertificateRequestInfo.Context">
|
|
(*CertificateRequestInfo).Context
|
|
</a> methods respectively. Canceling the context after the handshake has finished
|
|
has no effect.
|
|
</p>
|
|
|
|
<p><!-- CL 289209 -->
|
|
When <a href="/pkg/crypto/tls#Config">Config.NextProtos</a> is set, servers now
|
|
enforce that there is an overlap between the configured protocols and the protocols
|
|
advertised by the client, if any. If there is no overlap the connection is closed
|
|
with the <code>no_application_protocol</code> alert, as required by RFC 7301.
|
|
</p>
|
|
|
|
<h3 id="runtime/cgo"><a href="/pkg/runtime/cgo">Cgo</a></h3>
|
|
|
|
<p>
|
|
The <a href="/pkg/runtime/cgo">runtime/cgo</a> package now provides a
|
|
new facility that allows to turn any Go values to a safe representation
|
|
that can be used to pass values between C and Go safely. See
|
|
<a href="/pkg/runtime/cgo#Handle">runtime/cgo.Handle</a> for more information.
|
|
</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>
|
|
|
|
<dl id="archive/zip"><dt><a href="/pkg/archive/zip/">archive/zip</a></dt>
|
|
<dd>
|
|
<p><!-- CL 312310 -->
|
|
The new methods <a href="/pkg/archive/zip#File.OpenRaw"><code>File.OpenRaw</code></a>, <a href="/pkg/archive/zip#Writer.CreateRaw"><code>Writer.CreateRaw</code></a>, <a href="/pkg/archive/zip#Writer.Copy"><code>Writer.Copy</code></a> provide support for cases where performance is a primary concern.
|
|
</p>
|
|
</dd>
|
|
</dl><!-- archive/zip -->
|
|
|
|
<dl id="bufio"><dt><a href="/pkg/bufio/">bufio</a></dt>
|
|
<dd>
|
|
<p><!-- CL 280492 -->
|
|
The <a href="/pkg/bufio/#Writer.WriteRune"><code>Writer.WriteRune</code></a> method
|
|
now writes the replacement character U+FFFD for negative rune values,
|
|
as it does for other invalid runes.
|
|
</p>
|
|
</dd>
|
|
</dl><!-- bufio -->
|
|
|
|
<dl id="bytes"><dt><a href="/pkg/bytes/">bytes</a></dt>
|
|
<dd>
|
|
<p><!-- CL 280492 -->
|
|
The <a href="/pkg/bytes/#Buffer.WriteRune"><code>Buffer.WriteRune</code></a> method
|
|
now writes the replacement character U+FFFD for negative rune values,
|
|
as it does for other invalid runes.
|
|
</p>
|
|
</dd>
|
|
</dl><!-- bytes -->
|
|
|
|
<dl id="compress/lzw"><dt><a href="/pkg/compress/lzw/">compress/lzw</a></dt>
|
|
<dd>
|
|
<p><!-- CL 273667 -->
|
|
The <a href="/pkg/compress/lzw/#NewReader"><code>NewReader</code></a>
|
|
function is guaranteed to return a value of the new
|
|
type <a href="/pkg/compress/lzw/#Reader"><code>Reader</code></a>,
|
|
and similarly <a href="/pkg/compress/lzw/#NewWriter"><code>NewWriter</code></a>
|
|
is guaranteed to return a value of the new
|
|
type <a href="/pkg/compress/lzw/#Writer"><code>Writer</code></a>.
|
|
These new types both implement a <code>Reset</code> method
|
|
(<a href="/pkg/compress/lzw/#Reader.Reset"><code>Reader.Reset</code></a>,
|
|
<a href="/pkg/compress/lzw/#Writer.Reset"><code>Writer.Reset</code></a>)
|
|
that allows reuse of the <code>Reader</code> or <code>Writer</code>.
|
|
</p>
|
|
</dd>
|
|
</dl><!-- compress/lzw -->
|
|
|
|
<dl id="crypto/rsa"><dt><a href="/pkg/crypto/rsa/">crypto/rsa</a></dt>
|
|
<dd>
|
|
<p><!-- CL 302230 -->
|
|
TODO: <a href="https://golang.org/cl/302230">https://golang.org/cl/302230</a>: fix salt length calculation with PSSSaltLengthAuto
|
|
</p>
|
|
</dd>
|
|
</dl><!-- crypto/rsa -->
|
|
|
|
<dl id="database/sql"><dt><a href="/pkg/database/sql/">database/sql</a></dt>
|
|
<dd>
|
|
<p><!-- CL 258360 -->
|
|
The <a href="/pkg/database/sql/#DB.Close"><code>DB.Close</code></a> method now closes
|
|
the <code>connector</code> field if the type in this field implements the
|
|
<a href="/pkg/io/#Closer"><code>io.Closer</code></a> interface.
|
|
</p>
|
|
|
|
<p><!-- CL 311572 -->
|
|
The new
|
|
<a href="/pkg/database/sql/#NullInt16"><code>NullInt16</code></a>
|
|
and
|
|
<a href="/pkg/database/sql/#NullByte"><code>NullByte</code></a>
|
|
structs represent the int16 and byte values that may be null. These can be used as
|
|
destinations of the <a href="/pkg/database/sql/#Scan"><code>Scan</code></a> method,
|
|
similar to NullString.
|
|
</p>
|
|
</dd>
|
|
</dl><!-- database/sql -->
|
|
|
|
<dl id="debug/elf"><dt><a href="/pkg/debug/elf/">debug/elf</a></dt>
|
|
<dd>
|
|
<p><!-- CL 239217 -->
|
|
The <a href="/pkg/debug/elf/#SHT_MIPS_ABIFLAGS"><code>SHT_MIPS_ABIFLAGS</code></a>
|
|
constant has been added.
|
|
</p>
|
|
</dd>
|
|
</dl><!-- debug/elf -->
|
|
|
|
<dl id="encoding/binary"><dt><a href="/pkg/encoding/binary/">encoding/binary</a></dt>
|
|
<dd>
|
|
<p><!-- CL 299531 -->
|
|
<code>binary.Uvarint</code> will stop reading after <code>10 bytes</code> to avoid
|
|
wasted computations. If more than <code>10 bytes</code> are needed, the byte count returned is <code>-11</code>.
|
|
<br />
|
|
Previous Go versions could return larger negative counts when reading incorrectly encoded varints.
|
|
</p>
|
|
</dd>
|
|
</dl><!-- encoding/binary -->
|
|
|
|
<dl id="encoding/csv"><dt><a href="/pkg/encoding/csv/">encoding/csv</a></dt>
|
|
<dd>
|
|
<p><!-- CL 291290 -->
|
|
The new
|
|
<a href="/pkg/encoding/csv/#Reader.FieldPos"><code>Reader.FieldPos</code></a>
|
|
method returns the line and column corresponding to the start of
|
|
a given field in the record most recently returned by
|
|
<a href="/pkg/encoding/csv/#Reader.Read"><code>Read</code></a>.
|
|
</p>
|
|
</dd>
|
|
</dl><!-- encoding/csv -->
|
|
|
|
<dl id="flag"><dt><a href="/pkg/flag/">flag</a></dt>
|
|
<dd>
|
|
<p><!-- CL 271788 -->
|
|
TODO: <a href="https://golang.org/cl/271788">https://golang.org/cl/271788</a>: panic if flag name begins with - or contains =
|
|
</p>
|
|
</dd>
|
|
</dl><!-- flag -->
|
|
|
|
<dl id="go/build"><dt><a href="/pkg/go/build/">go/build</a></dt>
|
|
<dd>
|
|
<p><!-- CL 310732 -->
|
|
The new
|
|
<a href="/pkg/go/build/#Context.ToolTags"><code>Context.ToolTags</code></a>
|
|
field holds the build tags appropriate to the current Go
|
|
toolchain configuration.
|
|
</p>
|
|
</dd>
|
|
</dl><!-- go/build -->
|
|
|
|
<dl id="io/fs"><dt><a href="/pkg/io/fs/">io/fs</a></dt>
|
|
<dd>
|
|
<p><!-- CL 293649 -->
|
|
The new <a href="/pkg/io/fs/#FileInfoToDirEntry"><code>FileInfoToDirEntry</code></a> function converts a <code>FileInfo</code> to a <code>DirEntry</code>.
|
|
</p>
|
|
</dd>
|
|
</dl><!-- io/fs -->
|
|
|
|
<dl id="math"><dt><a href="/pkg/math/">math</a></dt>
|
|
<dd>
|
|
<p><!-- CL 247058 -->
|
|
The math package now defines three more constants: <code>MaxUint</code>, <code>MaxInt</code> and <code>MinInt</code>.
|
|
For 32-bit systems their values are <code>2^32 - 1</code>, <code>2^31 - 1</code> and <code>-2^31</code>, respectively.
|
|
For 64-bit systems their values are <code>2^64 - 1</code>, <code>2^63 - 1</code> and <code>-2^63</code>, respectively.
|
|
</p>
|
|
</dd>
|
|
</dl><!-- math -->
|
|
|
|
<dl id="mime"><dt><a href="/pkg/mime/">mime</a></dt>
|
|
<dd>
|
|
<p><!-- CL 305230 -->
|
|
On Unix systems, the table of MIME types is now read from the local system's
|
|
<a href="https://specifications.freedesktop.org/shared-mime-info-spec/shared-mime-info-spec-0.21.html">Shared MIME-info Database</a>
|
|
when available.
|
|
</p>
|
|
</dd>
|
|
</dl><!-- mime -->
|
|
|
|
<dl id="net"><dt><a href="/pkg/net/">net</a></dt>
|
|
<dd>
|
|
<p><!-- CL 272668 -->
|
|
The new method <a href="/pkg/net/#IP.IsPrivate"><code>IP.IsPrivate</code></a> reports whether an address is
|
|
a private IPv4 address according to <a href="http://tools.ietf.org/html/rfc1918">RFC 1918</a>
|
|
or a local IPv6 address according <a href="http://tools.ietf.org/html/rfc4193">RFC 4193</a>.
|
|
</p>
|
|
|
|
<p><!-- CL 301709 -->
|
|
The Go DNS resolver now only sends one DNS query when resolving an address for an IPv4-only or IPv6-only network,
|
|
rather than querying for both address families.
|
|
</p>
|
|
|
|
<p><!-- CL 307030 -->
|
|
The <a href="/pkg/net/#ErrClosed"><code>ErrClosed</code></a> sentinel error and
|
|
<a href="/pkg/net/#ParseError"><code>ParseError</code></a> error type now implement
|
|
the <a href="/pkg/net/#Error"><code>net.Error</code></a> interface.
|
|
</p>
|
|
</dd>
|
|
</dl><!-- net -->
|
|
|
|
<dl id="net/http"><dt><a href="/pkg/net/http/">net/http</a></dt>
|
|
<dd>
|
|
<p><!-- CL 295370 -->
|
|
The <a href="/pkg/net/http/"><code>net/http</code></a> package now uses the new
|
|
<a href="/pkg/crypto/tls#Conn.HandshakeContext"><code>(*tls.Conn).HandshakeContext</code></a>
|
|
with the <a href="/pkg/net/http/#Request"><code>Request</code></a> context
|
|
when performing TLS handshakes in the client or server.
|
|
</p>
|
|
|
|
<p><!-- CL 235437 -->
|
|
Setting the <a href="/pkg/net/http/#Server"><code>Server</code></a>
|
|
<code>ReadTimeout</code> or <code>WriteTimeout</code> fields to a negative value now indicates no timeout
|
|
rather than an immediate timeout.
|
|
</p>
|
|
|
|
<p><!-- CL 308952 -->
|
|
The <a href="/pkg/net/http/#ReadRequest"><code>ReadRequest</code></a> function
|
|
now returns an error when the request has multiple Host headers.
|
|
</p>
|
|
</dd>
|
|
</dl><!-- net/http -->
|
|
|
|
<dl id="net/http/httptest"><dt><a href="/pkg/net/http/httptest/">net/http/httptest</a></dt>
|
|
<dd>
|
|
<p><!-- CL 308950 -->
|
|
<a href="/pkg/net/http/httptest/#ResponseRecorder.WriteHeader"><code>ResponseRecorder.WriteHeader></code></a>
|
|
now panics when the provided code is not a valid three-digit HTTP status code.
|
|
This matches the behavior of <a href="/pkg/net/http/#ResponseWriter"><code>ResponseWriter></code></a>
|
|
implementations in the <a href="/pkg/net/http/"><code>net/http</code></a> package.
|
|
</p>
|
|
</dd>
|
|
</dl><!-- net/http/httptest -->
|
|
|
|
<dl id="net/url"><dt><a href="/pkg/net/url/">net/url</a></dt>
|
|
<dd>
|
|
<p><!-- CL 314850 -->
|
|
The new method <a href="/pkg/net/url/#Values.Has"><code>Values.Has</code></a>
|
|
reports whether a query parameter is set.
|
|
</p>
|
|
</dd>
|
|
</dl><!-- net/url -->
|
|
|
|
<dl id="os"><dt><a href="/pkg/os/">os</a></dt>
|
|
<dd>
|
|
<p><!-- CL 268020 -->
|
|
The <a href="/pkg/os/#File.WriteString"><code>File.WriteString</code></a> method
|
|
has been optimized to no longer make a copy of the input string.
|
|
</p>
|
|
</dd>
|
|
</dl><!-- os -->
|
|
|
|
<dl id="reflect"><dt><a href="/pkg/reflect/">reflect</a></dt>
|
|
<dd>
|
|
<p><!-- CL 266197 -->
|
|
The new
|
|
<a href="/pkg/reflect/#StructField.IsExported"><code>StructField.IsExported</code></a>
|
|
and
|
|
<a href="/pkg/reflect/#Method.IsExported"><code>Method.IsExported</code></a>
|
|
methods report whether a struct field or type method is exported.
|
|
They provide a more readable alternative to checking whether <code>PkgPath</code>
|
|
is empty.
|
|
</p>
|
|
|
|
<p><!-- CL 281233 -->
|
|
The new <a href="/pkg/reflect/#VisibleFields"><code>VisibleFields</code></a> function
|
|
returns all the visible fields in a struct type, including fields inside anonymous struct members.
|
|
</p>
|
|
|
|
<p><!-- CL 284136 -->
|
|
The <a href="/pkg/reflect/#ArrayOf"><code>ArrayOf</code></a> function now panics when
|
|
called with a negative length.
|
|
</p>
|
|
</dd>
|
|
</dl><!-- reflect -->
|
|
|
|
<dl id="runtime/metrics"><dt><a href="/pkg/runtime/metrics">runtime/metrics</a></dt>
|
|
<dd>
|
|
<p><!-- CL 308933, CL 312431, CL 312909 -->
|
|
New metrics were added that track total bytes and objects allocated and freed.
|
|
A new metric tracking the distribution of goroutine scheduling latencies was
|
|
also added.
|
|
</p>
|
|
</dd>
|
|
</dl><!-- runtime/metrics -->
|
|
|
|
<dl id="strconv"><dt><a href="/pkg/strconv/">strconv</a></dt>
|
|
<dd>
|
|
<p><!-- CL 170079 -->
|
|
TODO: <a href="https://golang.org/cl/170079">https://golang.org/cl/170079</a>: implement Ryū-like algorithm for fixed precision ftoa
|
|
</p>
|
|
|
|
<p><!-- CL 170080 -->
|
|
TODO: <a href="https://golang.org/cl/170080">https://golang.org/cl/170080</a>: Implement Ryū algorithm for ftoa shortest mode
|
|
</p>
|
|
|
|
<p><!-- CL 314775 -->
|
|
The new <a href="/pkg/strconv/#QuotedPrefix"><code>QuotedPrefix</code></a> function
|
|
returns the quoted string (as understood by
|
|
<a href="/pkg/strconv/#Unquote"><code>Unquote</code></a>)
|
|
at the start of input.
|
|
</p>
|
|
</dd>
|
|
</dl><!-- strconv -->
|
|
|
|
<dl id="strings"><dt><a href="/pkg/strings/">strings</a></dt>
|
|
<dd>
|
|
<p><!-- CL 280492 -->
|
|
The <a href="/pkg/strings/#Builder.WriteRune"><code>Builder.WriteRune</code></a> method
|
|
now writes the replacement character U+FFFD for negative rune values,
|
|
as it does for other invalid runes.
|
|
</p>
|
|
</dd>
|
|
</dl><!-- strings -->
|
|
|
|
<dl id="sync/atomic"><dt><a href="/pkg/sync/atomic/">sync/atomic</a></dt>
|
|
<dd>
|
|
<p><!-- CL 241678 -->
|
|
<code>atomic.Value</code> now has <a href="/pkg/sync/atomic/#Value.Swap"><code>Swap</code></a> and
|
|
<a href="/pkg/sync/atomic/#Value.CompareAndSwap"><code>CompareAndSwap</code></a> methods that provide
|
|
additional atomic operations.
|
|
</p>
|
|
</dd>
|
|
</dl><!-- sync/atomic -->
|
|
|
|
<dl id="syscall"><dt><a href="/pkg/syscall/">syscall</a></dt>
|
|
<dd>
|
|
<p><!-- CL 295371 -->
|
|
<p>
|
|
The <a href="/pkg/syscall/#GetQueuedCompletionStatus"><code>GetQueuedCompletionStatus</code></a> and
|
|
<a href="/pkg/syscall/#PostQueuedCompletionStatus"><code>PostQueuedCompletionStatus</code></a>
|
|
functions are now deprecated. These functions have incorrect signatures and are superseded by
|
|
equivalents in the <a href="https://godoc.org/golang.org/x/sys/windows"><code>golang.org/x/sys/windows</code></a> package.
|
|
</p>
|
|
|
|
<p><!-- CL 313653 -->
|
|
On Unix-like systems, the process group of a child process is now set with signals blocked.
|
|
This avoids sending a <code>SIGTTOU</code> to the child when the parent is in a background process group.
|
|
</p>
|
|
|
|
<p><!-- CL 288298, CL 288300 -->
|
|
The Windows version of
|
|
<a href="/pkg/syscall/#SysProcAttr"><code>SysProcAttr</code></a>
|
|
has two new fields. <code>AdditionalInheritedHandles</code> is
|
|
a list of additional handles to be inherited by the new child
|
|
process. <code>ParentProcess</code> permits specifying the
|
|
parent process of the new process.
|
|
|
|
<p><!-- CL 311570 -->
|
|
The constant <code>MSG_CMSG_CLOEXEC</code> is now defined on
|
|
DragonFly and all OpenBSD systems (it was already defined on
|
|
some OpenBSD systems and all FreeBSD, NetBSD, and Linux systems).
|
|
</p>
|
|
</dd>
|
|
</dl><!-- syscall -->
|
|
|
|
<dl id="testing"><dt><a href="/pkg/testing/">testing</a></dt>
|
|
<dd>
|
|
<p><!-- CL 310033 -->
|
|
TODO: <a href="https://golang.org/cl/310033">https://golang.org/cl/310033</a>: add -shuffle=off|on|N to alter the execution order of tests and benchmarks
|
|
</p>
|
|
|
|
<p><!-- CL 260577 -->
|
|
The new
|
|
<a href="/pkg/testing/#T.Setenv"><code>T.Setenv</code></a>
|
|
and <a href="/pkg/testing/#B.Setenv"><code>B.Setenv</code></a>
|
|
methods support setting an environment variable for the duration
|
|
of the test or benchmark.
|
|
</p>
|
|
</dd>
|
|
</dl><!-- testing -->
|
|
|
|
<dl id="text/template/parse"><dt><a href="/pkg/text/template/parse/">text/template/parse</a></dt>
|
|
<dd>
|
|
<p><!-- CL 301493 -->
|
|
The new <a href="/pkg/text/template/parse/#Mode"><code>SkipFuncCheck</code></a> <a href=><code>Mode</code></a>
|
|
value changes the template parser to not verify that functions are defined.
|
|
</p>
|
|
</dd>
|
|
</dl><!-- text/template/parse -->
|
|
|
|
<dl id="time"><dt><a href="/pkg/time/">time</a></dt>
|
|
<dd>
|
|
<p><!-- CL 260858 -->
|
|
The <a href="/pkg/time/#Time"><code>Time</code></a> type now has a
|
|
<a href="/pkg/time/#Time.GoString"><code>GoString</code></a> method that
|
|
will return a more useful value for times when printed with the
|
|
<code>%#v</code> format specifier in the <code>fmt</code> package.
|
|
</p>
|
|
|
|
<p><!-- CL 264077 -->
|
|
TODO: <a href="https://golang.org/cl/264077">https://golang.org/cl/264077</a>: add Time.IsDST() to check if its Location is in Daylight Savings Time
|
|
</p>
|
|
|
|
<p><!-- CL 293349 -->
|
|
TODO: <a href="https://golang.org/cl/293349">https://golang.org/cl/293349</a>: add Time.Unix{Milli,Micro} and to-Time helpers UnixMicro, UnixMilli
|
|
</p>
|
|
|
|
<p><!-- CL 300996 -->
|
|
TODO: <a href="https://golang.org/cl/300996">https://golang.org/cl/300996</a>: support "," as separator for fractional seconds
|
|
</p>
|
|
|
|
<p><!-- CL 320252 -->
|
|
The new constant <a href="/pkg/time/#Layout"><code>Layout</code></a>
|
|
defines the reference time.
|
|
</p>
|
|
</dd>
|
|
</dl><!-- time -->
|
|
|
|
<dl id="unicode"><dt><a href="/pkg/unicode/">unicode</a></dt>
|
|
<dd>
|
|
<p><!-- CL 280493 -->
|
|
The <a href="/pkg/unicode/#Is"><code>Is</code></a>,
|
|
<a href="/pkg/unicode/#IsGraphic"><code>IsGraphic</code></a>,
|
|
<a href="/pkg/unicode/#IsLetter"><code>IsLetter</code></a>,
|
|
<a href="/pkg/unicode/#IsLower"><code>IsLower</code></a>,
|
|
<a href="/pkg/unicode/#IsMark"><code>IsMark</code></a>,
|
|
<a href="/pkg/unicode/#IsNumber"><code>IsNumber</code></a>,
|
|
<a href="/pkg/unicode/#IsPrint"><code>IsPrint</code></a>,
|
|
<a href="/pkg/unicode/#IsPunct"><code>IsPunct</code></a>,
|
|
<a href="/pkg/unicode/#IsSpace"><code>IsSpace</code></a>,
|
|
<a href="/pkg/unicode/#IsSymbol"><code>IsSymbol</code></a>, and
|
|
<a href="/pkg/unicode/#IsUpper"><code>IsUpper</code></a> functions
|
|
now return <code>false</code> on negative rune values, as they do for other invalid runes.
|
|
</p>
|
|
</dd>
|
|
</dl><!-- unicode -->
|