2017-06-05 18:04:12 -06:00
|
|
|
<!--{
|
|
|
|
"Title": "Go 1.9 Release Notes",
|
|
|
|
"Path": "/doc/go1.9",
|
|
|
|
"Template": true
|
|
|
|
}-->
|
|
|
|
|
|
|
|
<!--
|
|
|
|
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>
|
|
|
|
ul li { margin: 0.5em 0; }
|
|
|
|
</style>
|
|
|
|
|
|
|
|
<h2 id="introduction">DRAFT RELEASE NOTES - Introduction to Go 1.9</h2>
|
|
|
|
|
|
|
|
<p><strong>
|
|
|
|
Go 1.9 is not yet released. These are work-in-progress
|
|
|
|
release notes. Go 1.9 is expected to be released in August 2017.
|
|
|
|
</strong></p>
|
|
|
|
|
|
|
|
<p>
|
2017-06-06 16:03:45 -06:00
|
|
|
The latest Go release, version 1.9, arrives six months
|
|
|
|
after <a href="go1.8">Go 1.8</a> and is the tenth release in
|
|
|
|
the <a href="https://golang.org/doc/devel/release.html">Go 1.x
|
|
|
|
series</a>.
|
|
|
|
There is one <a href="#language">change to the language</a>, adding
|
|
|
|
support for type aliases.
|
|
|
|
Most of the changes are in the implementation of the toolchain,
|
|
|
|
runtime, and libraries.
|
|
|
|
As always, the release maintains the Go 1
|
|
|
|
<a href="/doc/go1compat.html">promise of compatibility</a>.
|
|
|
|
We expect almost all Go programs to continue to compile and run as
|
|
|
|
before.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
The release
|
|
|
|
adds <a href="#monotonic-time">transparent monotonic time support</a>,
|
|
|
|
<a href="#parallel-compile">parallelizes compilation of functions</a> within a package,
|
|
|
|
better supports <a href="#test-helper">test helper functions</a>,
|
2017-06-13 14:24:43 -06:00
|
|
|
includes a new <a href="#math-bits">bit manipulation package</a>,
|
|
|
|
and has a new <a href="#sync-map">concurrent map type</a>.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
2017-06-06 16:03:45 -06:00
|
|
|
<h2 id="language">Changes to the language</h2>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
There is one change to the language.
|
|
|
|
Go now supports type aliases to support gradual code repair while
|
|
|
|
moving a type between packages.
|
|
|
|
The <a href="https://golang.org/design/18130-type-alias">type alias
|
|
|
|
design document</a>
|
|
|
|
and <a href="https://talks.golang.org/2016/refactor.article">an
|
|
|
|
article on refactoring</a> cover the problem in detail.
|
|
|
|
In short, a type alias declaration has the form:
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<pre>
|
|
|
|
type T1 = T2
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
This declaration introduces an alias name <code>T1</code>—an
|
|
|
|
alternate spelling—for the type denoted by <code>T2</code>; that is,
|
|
|
|
both <code>T1</code> and <code>T2</code> denote the same type.
|
|
|
|
</p>
|
|
|
|
|
2017-06-05 18:04:12 -06:00
|
|
|
<h2 id="ports">Ports</h2>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
There are no new supported operating systems or processor
|
|
|
|
architectures in this release.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<h3 id="power8">ppc64x requires Power8</h3>
|
|
|
|
|
|
|
|
<p> <!-- CL 36725, CL 36832 -->
|
|
|
|
Both <code>GOARCH=ppc64</code> and <code>GOARCH=ppc64le</code> now
|
|
|
|
require at least Power8 support. In previous releases,
|
|
|
|
only <code>GOARCH=ppc64le</code> required Power8 and the big
|
|
|
|
endian <code>ppc64</code> architecture supported older
|
|
|
|
hardware.
|
|
|
|
<p>
|
|
|
|
|
|
|
|
<h3 id="known_issues">Known Issues</h3>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
There are some instabilities on FreeBSD that are known but not understood.
|
|
|
|
These can lead to program crashes in rare cases.
|
|
|
|
See <a href="https://golang.org/issue/15658">issue 15658</a>.
|
|
|
|
Any help in solving this FreeBSD-specific issue would be appreciated.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<h2 id="tools">Tools</h2>
|
|
|
|
|
|
|
|
<h3 id="parallel-compile">Parallel Compilation</h3>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
The Go compiler now supports compiling a package's functions in parallel, taking
|
|
|
|
advantage of multiple cores. This is in addition to the <code>go</code> command's
|
|
|
|
existing support for parallel compilation of separate packages.
|
|
|
|
Parallel compilation is on by default, but can be disabled by setting the
|
|
|
|
environment variable <code>GO19CONCURRENTCOMPILATION</code> to <code>0</code>.
|
|
|
|
</p>
|
|
|
|
|
2017-06-08 11:35:58 -06:00
|
|
|
<h3 id="compiler">Compiler Toolchain</h3>
|
|
|
|
|
|
|
|
<p><!-- CL 37441 -->
|
|
|
|
Complex division is now C99-compatible. This has always been the
|
|
|
|
case in gccgo and is now fixed in the gc toolchain.
|
|
|
|
</p>
|
|
|
|
|
2017-06-09 01:24:00 -06:00
|
|
|
<p> <!-- CL 36983 -->
|
|
|
|
The linker will now generate DWARF information for cgo executables on Windows.
|
|
|
|
</p>
|
|
|
|
|
2017-06-14 11:58:27 -06:00
|
|
|
<p> <!-- CL 44210, CL 40095 -->
|
|
|
|
The compiler now includes lexical scopes in the generated DWARF, allowing
|
|
|
|
debuggers to hide variables that are not in scope. The <code>.debug_info</code>
|
|
|
|
section is now DWARF version 4.
|
|
|
|
</p>
|
|
|
|
|
2017-06-07 02:54:52 -06:00
|
|
|
<h3 id="go-test-list">Go test</h3>
|
|
|
|
|
|
|
|
<p> <!-- CL 41195 -->
|
|
|
|
The <a href="/cmd/go/#hdr-Description_of_testing_flags"><code>go</code> <code>test</code></a>
|
|
|
|
command accepts a new <code>-list</code> flag, which takes a regular
|
|
|
|
expression as an argument and prints to stdout the name of any
|
|
|
|
tests, benchmarks, or examples that match it, without running them.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
2017-06-05 18:04:12 -06:00
|
|
|
<!-- CL 42028: https://golang.org/cl/42028: cmd/asm: fix operand order of ARM's MULA instruction -->
|
|
|
|
<!-- CL 36031: https://golang.org/cl/36031: cmd/doc: truncate long lists of arguments -->
|
|
|
|
<!-- CL 38438: https://golang.org/cl/38438: cmd/doc: implement "go doc struct.field" -->
|
|
|
|
<!-- CL 38745: https://golang.org/cl/38745: cmd/go: exclude vendored packages from ... matches -->
|
|
|
|
<!-- CL 38757: https://golang.org/cl/38757: cmd/go: add -json flag to go env -->
|
|
|
|
<!-- CL 40112: https://golang.org/cl/40112: cmd/go: allow full flag processing in go vet -->
|
|
|
|
<!-- CL 43855: https://golang.org/cl/43855: cmd/go: include GOARM and GO386 in computed build ID -->
|
|
|
|
<!-- CL 42990: https://golang.org/cl/42990: cmd/internal/obj/x86: add ADDSUBPS/PD -->
|
|
|
|
<!-- CL 40331: https://golang.org/cl/40331: cmd/link,runtime/cgo: enable PT_TLS generation on OpenBSD -->
|
|
|
|
<!-- CL 38343: https://golang.org/cl/38343: cmd/pprof: use proxy from environment -->
|
|
|
|
|
|
|
|
|
|
|
|
<h2 id="performance">Performance</h2>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
As always, the changes are so general and varied that precise
|
|
|
|
statements about performance are difficult to make. Most programs
|
|
|
|
should run a bit faster, due to speedups in the garbage collector,
|
|
|
|
better generated code, and optimizations in the core library.
|
|
|
|
</p>
|
|
|
|
|
2017-06-13 07:59:53 -06:00
|
|
|
<p> <!-- CL 39203 -->
|
2017-06-05 18:04:12 -06:00
|
|
|
TODO: There have been significant optimizations bringing more than 10% improvements
|
|
|
|
to implementations in the
|
2017-06-13 07:59:53 -06:00
|
|
|
<a href="/pkg/encoding/gob"><code>encoding/gob</code></a>, and ...
|
2017-06-05 18:04:12 -06:00
|
|
|
packages.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<h3 id="gc">Garbage Collector</h3>
|
|
|
|
|
2017-06-08 08:17:48 -06:00
|
|
|
<p> <!-- CL 37520 -->
|
|
|
|
Library functions that used to trigger stop-the-world garbage
|
|
|
|
collection now trigger concurrent garbage collection.
|
|
|
|
|
|
|
|
Specifically, <a href="/pkg/runtime/#GC"><code>runtime.GC</code></a>,
|
|
|
|
<a href="/pkg/runtime/debug/#SetGCPercent"><code>debug.SetGCPercent</code></a>,
|
|
|
|
and
|
|
|
|
<a href="/pkg/runtime/debug/#FreeOSMemory"><code>debug.FreeOSMemory</code></a>,
|
|
|
|
now trigger concurrent garbage collection, blocking only the calling
|
|
|
|
goroutine until the garbage collection is done.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p> <!-- CL 34103, CL 39835 -->
|
|
|
|
The
|
|
|
|
<a href="/pkg/runtime/debug/#SetGCPercent"><code>debug.SetGCPercent</code></a>
|
|
|
|
function only triggers a garbage collection if one is immediately
|
|
|
|
necessary because of the new GOGC value.
|
|
|
|
This makes it possible to adjust GOGC on-the-fly.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p> <!-- CL 38732 -->
|
|
|
|
Large object allocation performance is significantly improved in
|
|
|
|
applications using large (>50GB) heaps containing many large
|
|
|
|
objects.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p> <!-- CL 34937 -->
|
|
|
|
The <a href="/pkg/runtime/#ReadMemStats"><code>runtime.ReadMemStats</code></a>
|
|
|
|
function now takes less than 100µs even for very large heaps.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<h2 id="library">Core library</h2>
|
|
|
|
|
|
|
|
<h3 id="monotonic-time">Transparent Monotonic Time support</h3>
|
|
|
|
|
|
|
|
<p> <!-- CL 36255 -->
|
|
|
|
The <a href="/pkg/time/"><code>time</code></a> package now transparently
|
|
|
|
tracks monotonic time in each <a href="/pkg/time/#Time"><code>Time</code></a>
|
|
|
|
value, making computing durations between two <code>Time</code> values
|
|
|
|
a safe operation in the presence of wall clock adjustments.
|
|
|
|
See the <a href="/pkg/time/#hdr-Monotonic_Clocks">package docs</a> and
|
|
|
|
<a href="https://golang.org/design/12914-monotonic">design document</a>
|
|
|
|
for details.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<h3 id="math-bits">New bit manipulation package</h3>
|
|
|
|
|
2017-06-07 03:15:55 -06:00
|
|
|
<p> <!-- CL 36315 -->
|
2017-06-05 18:04:12 -06:00
|
|
|
Go 1.9 includes a new package,
|
|
|
|
<a href="/pkg/math/bits/"><code>math/bits</code></a>, with optimized
|
|
|
|
implementations for manipulating bits. On most architectures
|
|
|
|
functions in this package are additionally recognized by the
|
|
|
|
compiler and treated as intrinsics for additional performance.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<h3 id="test-helper">Test Helper Functions</h3>
|
|
|
|
|
|
|
|
<p> <!-- CL 38796 -->
|
|
|
|
The
|
|
|
|
new <a href="/pkg/testing/#T.Helper"><code>(*T).Helper</code></a>
|
|
|
|
an <a href="/pkg/testing/#B.Helper"><code>(*B).Helper</code></a>
|
2017-06-06 16:03:45 -06:00
|
|
|
methods mark the calling function as a test helper function. When
|
2017-06-05 18:04:12 -06:00
|
|
|
printing file and line information, that function will be skipped.
|
|
|
|
This permits writing test helper functions while still having useful
|
|
|
|
line numbers for users.
|
|
|
|
</p>
|
|
|
|
|
2017-06-13 14:24:43 -06:00
|
|
|
<h3 id="sync-map">Concurrent Map</h3>
|
|
|
|
|
|
|
|
<p> <!-- CL 36617 -->
|
|
|
|
The new <a href="/pkg/sync/#Map"><code>Map</code></a> type
|
|
|
|
in the <a href="/pkg/sync/"><code>sync</code></a> package
|
|
|
|
is a concurrent map with amortized-constant-time loads, stores, and
|
|
|
|
deletes. It is safe for multiple goroutines to call a Map's methods
|
|
|
|
concurrently.
|
|
|
|
</p>
|
|
|
|
|
2017-06-05 18:04:12 -06:00
|
|
|
<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 39570 -->
|
2017-06-13 12:46:28 -06:00
|
|
|
The
|
|
|
|
ZIP <a href="/pkg/archive/zip/#Writer"><code>Writer</code></a>
|
|
|
|
now sets the UTF-8 bit in
|
|
|
|
the <a href="/pkg/archive/zip/#FileHeader.Flags"><code>FileHeader.Flags</code></a>
|
|
|
|
when appropriate.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
</dl><!-- archive/zip -->
|
|
|
|
|
|
|
|
<dl id="crypto/rand"><dt><a href="/pkg/crypto/rand/">crypto/rand</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p><!-- CL 43852 -->
|
2017-06-13 12:46:28 -06:00
|
|
|
On Linux, Go now calls the <code>getrandom</code> system call
|
|
|
|
without the <code>GRND_NONBLOCK</code> flag; it will now block
|
|
|
|
until the kernel has sufficient randomness. On kernels predating
|
|
|
|
the <code>getrandom</code> system call, Go continues to read
|
|
|
|
from <code>/dev/urandom</code>.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
</dl><!-- crypto/rand -->
|
|
|
|
|
|
|
|
<dl id="crypto/x509"><dt><a href="/pkg/crypto/x509/">crypto/x509</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p><!-- CL 36093 -->
|
2017-06-13 12:46:28 -06:00
|
|
|
|
2017-06-13 14:24:43 -06:00
|
|
|
On Unix systems the environment
|
2017-06-13 12:46:28 -06:00
|
|
|
variables <code>SSL_CERT_FILE</code>
|
|
|
|
and <code>SSL_CERT_DIR</code> can now be used to override the
|
|
|
|
system default locations for the SSL certificate file and SSL
|
|
|
|
certificate files directory, respectively.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>The FreeBSD path <code>/usr/local/etc/ssl/cert.pem</code> is
|
|
|
|
now included in the certificate search path.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<p><!-- CL 36900 -->
|
2017-06-13 12:46:28 -06:00
|
|
|
|
|
|
|
The package now supports excluded domains in name constraints.
|
|
|
|
In addition to enforcing such constraints,
|
|
|
|
<a href="/pkg/crypto/x509/#CreateCertificate"><code>CreateCertificate</code></a>
|
|
|
|
will create certificates with excluded name constraints
|
|
|
|
if the provided template certificate has the new
|
|
|
|
field
|
|
|
|
<a href="/pkg/crypto/x509/#Certificate.ExcludedDNSDomains"><code>ExcludedDNSDomains</code></a>
|
|
|
|
populated.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
</dl><!-- crypto/x509 -->
|
|
|
|
|
|
|
|
<dl id="database/sql"><dt><a href="/pkg/database/sql/">database/sql</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p><!-- CL 35476 -->
|
2017-06-13 13:35:20 -06:00
|
|
|
The package will now use a cached <a href="/pkg/database/sql/#Stmt"><code>Stmt</code></a> if
|
|
|
|
available in <a href="/pkg/database/sql/#Tx.Stmt"><code>Tx.Stmt</code></a>.
|
|
|
|
This prevents statements from being re-prepared each time
|
|
|
|
<a href="/pkg/database/sql/#Tx.Stmt"><code>Tx.Stmt</code></a> is called.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p><!-- CL 38533 -->
|
|
|
|
The package now allows drivers to implement their own argument checkers by implementing
|
|
|
|
<a href="/pkg/database/sql/driver/#NamedValueChecker"><code>driver.NamedValueChecker</code></a>.
|
|
|
|
This also allows drivers to support <code>OUTPUT</code> and <code>INOUT</code> parameter types.
|
|
|
|
<a href="/pkg/database/sql/#Out"><code>Out</code></a> should be used to return output parameters
|
|
|
|
when supported by the driver.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<p><!-- CL 39031 -->
|
2017-06-13 13:35:20 -06:00
|
|
|
<a href="/pkg/database/sql/#Rows.Scan"><code>Rows.Scan</code></a> can now scan user-defined string types.
|
|
|
|
Previously the package supported scanning into numeric types like <code>type Int int64</code>. It now also supports
|
|
|
|
scanning into string types like <code>type String string</code>.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<p><!-- CL 40694 -->
|
2017-06-13 13:35:20 -06:00
|
|
|
The new <a href="/pkg/database/sql/#DB.Conn"><code>DB.Conn</code></a> method returns the new
|
|
|
|
<a href="/pkg/database/sql/#Conn"><code>Conn</code></a> type representing an
|
|
|
|
exclusive connection to the database from the connection pool. All queries run on
|
|
|
|
a <a href="/pkg/database/sql/#Conn"><code>Conn</code></a> will use the same underlying
|
|
|
|
connection until <a href="/pkg/database/sql/#Conn.Close"><code>Conn.Close</code></a> is called
|
|
|
|
to return the connection to the connection pool.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
</dl><!-- database/sql -->
|
|
|
|
|
|
|
|
<dl id="encoding/asn1"><dt><a href="/pkg/encoding/asn1/">encoding/asn1</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p><!-- CL 38660 -->
|
2017-06-13 07:59:53 -06:00
|
|
|
The new
|
|
|
|
<a href="/pkg/encoding/asn1/#NullBytes"><code>NullBytes</code></a>
|
|
|
|
and
|
|
|
|
<a href="/pkg/encoding/asn1/#NullRawValue"><code>NullRawValue</code></a>
|
|
|
|
represent the <code>ASN.1 NULL</code> type.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
</dl><!-- encoding/asn1 -->
|
|
|
|
|
|
|
|
<dl id="encoding/base32"><dt><a href="/pkg/encoding/base32/">encoding/base32</a></dt>
|
|
|
|
<dd>
|
2017-06-13 07:59:53 -06:00
|
|
|
<p><!-- CL 38634 -->
|
|
|
|
The new <a href="/pkg/encoding/base32/#Encoding.WithPadding">Encoding.WithPadding</a>
|
|
|
|
method adds support for custom padding characters and disabling padding.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
</dl><!-- encoding/base32 -->
|
|
|
|
|
|
|
|
<dl id="fmt"><dt><a href="/pkg/fmt/">fmt</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p><!-- CL 37051 -->
|
2017-06-13 12:46:28 -06:00
|
|
|
The sharp flag ('<code>#</code>') is now supported when printing
|
|
|
|
floating point and complex numbers. It will always print a
|
|
|
|
decimal point
|
|
|
|
for <code>%e</code>, <code>%E</code>, <code>%f</code>, <code>%F</code>, <code>%g</code>
|
|
|
|
and <code>%G</code>; it will not remove trailing zeros
|
|
|
|
for <code>%g</code> and <code>%G</code>.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
</dl><!-- fmt -->
|
|
|
|
|
|
|
|
<dl id="hash/fnv"><dt><a href="/pkg/hash/fnv/">hash/fnv</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p><!-- CL 38356 -->
|
2017-06-13 12:46:28 -06:00
|
|
|
The package now includes 128-bit FNV-1 and FNV-1a hash support with
|
|
|
|
<a href="/pkg/hash/fnv/#New128"><code>New128</code></a> and
|
|
|
|
<a href="/pkg/hash/fnv/#New128a"><code>New128a</code></a>, respectively.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
</dl><!-- hash/fnv -->
|
|
|
|
|
|
|
|
<dl id="html/template"><dt><a href="/pkg/html/template/">html/template</a></dt>
|
|
|
|
<dd>
|
2017-06-14 03:55:05 -06:00
|
|
|
<p><!-- CL 37880, CL 40936 -->
|
|
|
|
The package now reports an error if a predefined escaper (one of
|
|
|
|
"html", "urlquery" and "js") is found in a pipeline and its
|
|
|
|
rewriting by the contextual auto-escaper could potentially lead
|
|
|
|
to security or correctness issues.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
</dl><!-- html/template -->
|
|
|
|
|
|
|
|
<dl id="image"><dt><a href="/pkg/image/">image</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p><!-- CL 36734 -->
|
2017-06-08 02:59:31 -06:00
|
|
|
The <a href="/pkg/image/#Rectangle.Intersect"><code>Rectangle.Intersect</code></a>
|
|
|
|
method now returns a zero <code>Rectangle</code> when called on
|
|
|
|
adjacent but non-overlapping rectangles, as documented. In
|
|
|
|
earlier releases it would incorrectly return an empty but
|
|
|
|
non-zero <code>Rectangle</code>.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
</dl><!-- image -->
|
|
|
|
|
|
|
|
<dl id="image/color"><dt><a href="/pkg/image/color/">image/color</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p><!-- CL 36732 -->
|
2017-06-08 02:59:31 -06:00
|
|
|
The YCbCr to RGBA conversion formula has been tweaked to ensure
|
|
|
|
that rounding adjustments span the complete [0, 0xffff] RGBA
|
|
|
|
range.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
</dl><!-- image/color -->
|
|
|
|
|
|
|
|
<dl id="image/png"><dt><a href="/pkg/image/png/">image/png</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p><!-- CL 34150 -->
|
2017-06-08 02:59:31 -06:00
|
|
|
The new <a href="/pkg/image/png/#Encoder.BufferPool"><code>Encoder.BufferPool</code></a>
|
|
|
|
field allows specifying an <a href="/pkg/image/png/#EncoderBufferPool"><code>EncoderBufferPool</code></a>,
|
|
|
|
that will be used by the encoder to get temporary <code>EncoderBuffer</code>
|
|
|
|
buffers when encoding a PNG image.
|
|
|
|
|
|
|
|
The use of a <code>BufferPool</code> reduces the number of
|
|
|
|
memory allocations performed while encoding multiple images.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<p><!-- CL 38271 -->
|
2017-06-08 02:59:31 -06:00
|
|
|
The package now supports the decoding of transparent 8-bit
|
|
|
|
grayscale ("Gray8") images.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
</dl><!-- image/png -->
|
|
|
|
|
|
|
|
<dl id="math/big"><dt><a href="/pkg/math/big/">math/big</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p><!-- CL 36487 -->
|
2017-06-13 12:46:28 -06:00
|
|
|
The new
|
|
|
|
<a href="/pkg/math/big/#Int.IsInt64"><code>IsInt64</code></a>
|
|
|
|
and
|
|
|
|
<a href="/pkg/math/big/#Int.IsUint64"><code>IsUint64</code></a>
|
|
|
|
methods report whether an <code>Int</code>
|
|
|
|
may be represented as an <code>int64</code> or <code>uint64</code>
|
|
|
|
value.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
</dl><!-- math/big -->
|
|
|
|
|
|
|
|
<dl id="mime/multipart"><dt><a href="/pkg/mime/multipart/">mime/multipart</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p><!-- CL 39223 -->
|
2017-06-13 12:46:28 -06:00
|
|
|
The new
|
|
|
|
<a href="/pkg/mime/multipart/#FileHeader.Size"><code>FileHeader.Size</code></a>
|
|
|
|
field describes the size of a file in a multipart message.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
</dl><!-- mime/multipart -->
|
|
|
|
|
|
|
|
<dl id="net"><dt><a href="/pkg/net/">net</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p><!-- CL 32572 -->
|
|
|
|
TODO: <a href="https://golang.org/cl/32572">https://golang.org/cl/32572</a>: add Resolver.StrictErrors
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p><!-- CL 37260 -->
|
|
|
|
TODO: <a href="https://golang.org/cl/37260">https://golang.org/cl/37260</a>: allow Resolver to use a custom dialer
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p><!-- CL 37402 -->
|
|
|
|
TODO: <a href="https://golang.org/cl/37402">https://golang.org/cl/37402</a>: implement deadline functionality on Pipe
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p><!-- CL 40510 -->
|
|
|
|
TODO: <a href="https://golang.org/cl/40510">https://golang.org/cl/40510</a>: don't enclose non-literal IPv6 addresses in square brackets
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p><!-- CL 40512 -->
|
|
|
|
TODO: <a href="https://golang.org/cl/40512">https://golang.org/cl/40512</a>: validate network in Dial{,IP} and Listen{Packet,IP} for IP networks
|
|
|
|
</p>
|
|
|
|
|
2017-06-13 12:46:28 -06:00
|
|
|
<p><!-- CL 37913 -->
|
|
|
|
The new methods
|
|
|
|
<a href="/pkg/net/#TCPConn.SyscallConn"><code>TCPConn.SyscallConn</code></a>,
|
|
|
|
<a href="/pkg/net/#IPConn.SyscallConn"><code>IPConn.SyscallConn</code></a>,
|
|
|
|
<a href="/pkg/net/#UDPConn.SyscallConn"><code>UDPConn.SyscallConn</code></a>,
|
|
|
|
and
|
|
|
|
<a href="/pkg/net/#UnixConn.SyscallConn"><code>UnixConn.SyscallConn</code></a>
|
|
|
|
provide access to the connections' underlying file descriptors.
|
|
|
|
</p>
|
|
|
|
|
2017-06-05 18:04:12 -06:00
|
|
|
</dl><!-- net -->
|
|
|
|
|
|
|
|
<dl id="net/http"><dt><a href="/pkg/net/http/">net/http</a></dt>
|
|
|
|
<dd>
|
|
|
|
|
2017-06-07 22:11:30 -06:00
|
|
|
<p>Server changes:</p>
|
|
|
|
<ul>
|
|
|
|
<li><!-- CL 38194 -->
|
|
|
|
<a href="/pkg/net/http/#ServeMux"><code>ServeMux</code></a> now ignores ports in the host
|
|
|
|
header when matching handlers. The host is matched unmodified for <code>CONNECT</code> requests.
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li><!-- CL 34727 -->
|
|
|
|
<a href="/pkg/net/http/#Server.WriteTimeout"><code>Server.WriteTimeout</code></a>
|
|
|
|
now applies to HTTP/2 connections and is enforced per-stream.
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li><!-- CL 43231 -->
|
|
|
|
HTTP/2 now uses the priority write scheduler by default.
|
|
|
|
Frames are scheduled by following HTTP/2 priorities as described in
|
|
|
|
<a href="https://tools.ietf.org/html/rfc7540#section-5.3">RFC 7540 Section 5.3</a>.
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<p>Client & Transport changes:</p>
|
|
|
|
<ul>
|
|
|
|
<li><!-- CL 35488 -->
|
|
|
|
The <a href="/pkg/net/http/#Transport"><code>Transport</code></a>
|
|
|
|
now supports making requests via SOCKS5 proxy when the URL returned by
|
|
|
|
<a href="/net/http/#Transport.Proxy"><code>Transport.Proxy</code></a>
|
|
|
|
has the scheme <code>socks5</code>.
|
|
|
|
</li>
|
|
|
|
</ul>
|
2017-06-05 18:04:12 -06:00
|
|
|
|
|
|
|
</dl><!-- net/http -->
|
|
|
|
|
|
|
|
<dl id="net/http/fcgi"><dt><a href="/pkg/net/http/fcgi/">net/http/fcgi</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p><!-- CL 40012 -->
|
2017-06-13 14:24:43 -06:00
|
|
|
The new
|
|
|
|
<a href="/pkg/net/http/fcgi/#ProcessEnv"><code>ProcessEnv</code></a>
|
|
|
|
function returns FastCGI environment variables associated with an HTTP request
|
|
|
|
for which there are no appropriate
|
|
|
|
<a href="/pkg/net/http/#Request"><code>http.Request</code></a>
|
|
|
|
fields, such as <code>REMOTE_USER</code>.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
</dl><!-- net/http/fcgi -->
|
|
|
|
|
|
|
|
<dl id="net/http/httptest"><dt><a href="/pkg/net/http/httptest/">net/http/httptest</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p><!-- CL 34639 -->
|
2017-06-13 14:24:43 -06:00
|
|
|
The new
|
|
|
|
<a href="/pkg/net/http/httptest/#Server.Client"><code>Server.Client</code></a>
|
|
|
|
method returns an HTTP client configured for making requests to the test server.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
The new
|
|
|
|
<a href="/pkg/net/http/httptest/#Server.Certificate"><code>Server.Certificate</code></a>
|
|
|
|
method returns the test server's TLS certificate, if any.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
</dl><!-- net/http/httptest -->
|
|
|
|
|
|
|
|
<dl id="net/rpc"><dt><a href="/pkg/net/rpc/">net/rpc</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p><!-- CL 38474 -->
|
|
|
|
TODO: <a href="https://golang.org/cl/38474">https://golang.org/cl/38474</a>: Create empty maps and slices as return type
|
|
|
|
</p>
|
|
|
|
|
|
|
|
</dl><!-- net/rpc -->
|
|
|
|
|
|
|
|
<dl id="os"><dt><a href="/pkg/os/">os</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p><!-- CL 37915 -->
|
|
|
|
TODO: <a href="https://golang.org/cl/37915">https://golang.org/cl/37915</a>: parse command line without shell32.dll
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p><!-- CL 41830 -->
|
|
|
|
TODO: <a href="https://golang.org/cl/41830">https://golang.org/cl/41830</a>: do not report ModeDir for symlinks on windows
|
|
|
|
</p>
|
|
|
|
|
|
|
|
</dl><!-- os -->
|
|
|
|
|
|
|
|
<dl id="os/exec"><dt><a href="/pkg/os/exec/">os/exec</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p><!-- CL 37586 -->
|
2017-06-13 14:24:43 -06:00
|
|
|
The <code>os/exec</code> package now prevents child processes from being created with
|
|
|
|
any duplicate environment variables.
|
|
|
|
If <a href="/pkg/os/exec/#Cmd.Env"><code>Cmd.Env</code></a>
|
|
|
|
contains duplicate environment keys, only the last
|
|
|
|
value in the slice for each duplicate key is used.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
</dl><!-- os/exec -->
|
|
|
|
|
|
|
|
<dl id="os/user"><dt><a href="/pkg/os/user/">os/user</a></dt>
|
|
|
|
<dd>
|
2017-06-13 14:24:43 -06:00
|
|
|
<p><!-- CL 37664 -->
|
|
|
|
<a href="/pkg/os/user/#Lookup"><code>Lookup</code></a> and
|
|
|
|
<a href="/pkg/os/user/#LookupId"><code>LookupId</code></a> now
|
|
|
|
work on Unix systems when <code>CGO_ENABLED=0</code> by reading
|
|
|
|
the <code>/etc/passwd</code> file.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
2017-06-13 14:24:43 -06:00
|
|
|
<p><!-- CL 33713 -->
|
|
|
|
<a href="/pkg/os/user/#LookupGroup"><code>LookupGroup</code></a> and
|
|
|
|
<a href="/pkg/os/user/#LookupGroupId"><code>LookupGroupId</code></a> now
|
|
|
|
work on Unix systems when <code>CGO_ENABLED=0</code> by reading
|
|
|
|
the <code>/etc/group</code> file.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
</dl><!-- os/user -->
|
|
|
|
|
|
|
|
<dl id="reflect"><dt><a href="/pkg/reflect/">reflect</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p><!-- CL 38335 -->
|
2017-06-13 14:24:43 -06:00
|
|
|
The new
|
|
|
|
<a href="/pkg/reflect/#MakeMapWithSize"><code>MakeMapWithSize</code></a>
|
|
|
|
function creates a map with a capacity hint.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
</dl><!-- reflect -->
|
|
|
|
|
|
|
|
<dl id="runtime"><dt><a href="/pkg/runtime/">runtime</a></dt>
|
|
|
|
<dd>
|
2017-06-08 11:35:58 -06:00
|
|
|
<p><!-- CL 37233, CL 37726 -->
|
|
|
|
Tracebacks generated by the runtime and recorded in profiles are
|
|
|
|
now accurate in the presence of inlining.
|
|
|
|
To retrieve tracebacks programmatically, applications should use
|
|
|
|
<a href="/pkg/runtime/#CallersFrames"><code>runtime.CallersFrames</code></a>
|
|
|
|
rather than directly iterating over the results of
|
|
|
|
<a href="/pkg/runtime/#Callers"><code>runtime.Callers</code></a>.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<p><!-- CL 38403 -->
|
2017-06-08 11:35:58 -06:00
|
|
|
On Windows, Go no longer forces the system timer to run at high
|
|
|
|
resolution when the program is idle.
|
|
|
|
This should reduce the impact of Go programs on battery life.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
2017-06-08 11:35:58 -06:00
|
|
|
<p><!-- CL 29341 -->
|
|
|
|
On FreeBSD, <code>GOMAXPROCS</code> and
|
|
|
|
<a href="/pkg/runtime/#NumCPU"><code>runtime.NumCPU</code></a>
|
|
|
|
are now based on the process' CPU mask, rather than the total
|
|
|
|
number of CPUs.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<p><!-- CL 43641 -->
|
2017-06-08 11:35:58 -06:00
|
|
|
The runtime has preliminary support for Android O.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
</dl><!-- runtime -->
|
|
|
|
|
|
|
|
<dl id="runtime/pprof"><dt><a href="/pkg/runtime/pprof/">runtime/pprof</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p><!-- CL 34198 -->
|
|
|
|
TODO: <a href="https://golang.org/cl/34198">https://golang.org/cl/34198</a>: add definitions of profile label types
|
|
|
|
</p>
|
|
|
|
|
|
|
|
</dl><!-- runtime/pprof -->
|
|
|
|
|
2017-06-08 11:35:58 -06:00
|
|
|
<dl id="runtime/trace"><dt><a href="/pkg/runtime/trace/">runtime/trace</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p><!-- CL 36015 -->
|
|
|
|
The execution trace now displays mark assist events, which
|
|
|
|
indicate when an application goroutine is forced to assist
|
|
|
|
garbage collection because it is allocating too quickly.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p><!-- CL 40810 -->
|
|
|
|
"Sweep" events now encompass the entire process of finding free
|
|
|
|
space for an allocation, rather than recording each individual
|
|
|
|
span that is swept.
|
|
|
|
This reduces allocation latency when tracing allocation-heavy
|
|
|
|
programs.
|
|
|
|
The sweep event shows how many bytes were swept and how many
|
|
|
|
were reclaimed.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
</dl><!-- runtime/trace -->
|
|
|
|
|
2017-06-05 18:04:12 -06:00
|
|
|
<dl id="sync"><dt><a href="/pkg/sync/">sync</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p><!-- CL 34310 -->
|
2017-06-13 14:24:43 -06:00
|
|
|
<a href="/pkg/sync/#Mutex"><code>Mutex</code></a> is now more fair.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
</dl><!-- sync -->
|
|
|
|
|
|
|
|
<dl id="syscall"><dt><a href="/pkg/syscall/">syscall</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p><!-- CL 36697 -->
|
2017-06-13 12:46:28 -06:00
|
|
|
The new field
|
|
|
|
<a href="/pkg/syscall/#Credential.NoSetGroups"><code>Credential.NoSetGroups</code></a>
|
2017-06-13 14:24:43 -06:00
|
|
|
controls whether Unix systems make a <code>setgroups</code> system call
|
2017-06-13 12:46:28 -06:00
|
|
|
to set supplementary groups when starting a new process.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<p><!-- CL 37439 -->
|
2017-06-13 12:46:28 -06:00
|
|
|
On 64-bit x86 Linux, process creation latency has been optimized with
|
|
|
|
use of <code>CLONE_VFORK</code> and <code>CLONE_VM</code>.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<p><!-- CL 37913 -->
|
2017-06-13 12:46:28 -06:00
|
|
|
The new
|
|
|
|
<a href="/pkg/syscall/#Conn"><code>Conn</code></a>
|
|
|
|
interface describes some types in the
|
|
|
|
<a href="/pkg/net/"><code>net</code></a>
|
|
|
|
package that can provide access to their underlying file descriptor
|
|
|
|
using the new
|
|
|
|
<a href="/pkg/syscall/#RawConn"><code>RawConn</code></a>
|
|
|
|
interface.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
</dl><!-- syscall -->
|
|
|
|
|
|
|
|
|
|
|
|
<dl id="testing/quick"><dt><a href="/pkg/testing/quick/">testing/quick</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p><!-- CL 39152 -->
|
2017-06-07 02:54:52 -06:00
|
|
|
The package now chooses values in the full range when
|
|
|
|
generating <code>int64</code> and <code>uint64</code> random
|
|
|
|
numbers; in earlier releases generated values were always
|
|
|
|
limited to the [-2<sup>62</sup>, 2<sup>62</sup>) range.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
</dl><!-- testing/quick -->
|
|
|
|
|
|
|
|
<dl id="text/template"><dt><a href="/pkg/text/template/">text/template</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p><!-- CL 38420 -->
|
2017-06-14 03:55:05 -06:00
|
|
|
The handling of empty blocks, which was broken by a Go 1.8
|
|
|
|
change that made the result dependent on the order of templates,
|
|
|
|
has been fixed, restoring the old Go 1.7 behavior.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
</dl><!-- text/template -->
|
|
|
|
|
|
|
|
<dl id="time"><dt><a href="/pkg/time/">time</a></dt>
|
|
|
|
<dd>
|
|
|
|
<p><!-- CL 36615 -->
|
2017-06-13 12:46:28 -06:00
|
|
|
The new methods
|
|
|
|
<a href="/pkg/time/#Duration.Round"><code>Duration.Round</code></a>
|
|
|
|
and
|
|
|
|
<a href="/pkg/time/#Duration.Truncate"><code>Duration.Truncate</code></a>
|
|
|
|
handle rounding durations away from and towards zero, respectively.
|
2017-06-05 18:04:12 -06:00
|
|
|
</p>
|
|
|
|
|
2017-06-08 11:35:58 -06:00
|
|
|
<p><!-- CL 35710 -->
|
|
|
|
Retrieving the time and sleeping now work correctly under Wine.
|
|
|
|
</p>
|
|
|
|
|
2017-06-05 18:04:12 -06:00
|
|
|
</dl><!-- time -->
|
|
|
|
|