2014-03-25 20:56:16 -06:00
|
|
|
<!--{
|
|
|
|
"Title": "Go 1.3 Release Notes",
|
|
|
|
"Path": "/doc/go1.3",
|
|
|
|
"Template": true
|
|
|
|
}-->
|
|
|
|
|
|
|
|
<h2 id="introduction">Introduction to Go 1.3</h2>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
The latest Go release, version 1.3, arrives six months after 1.2,
|
|
|
|
and contains no language changes.
|
2014-04-08 16:19:35 -06:00
|
|
|
It focuses primarily on implementation work, providing
|
2014-03-25 20:56:16 -06:00
|
|
|
precise garbage collection,
|
2014-04-08 16:19:35 -06:00
|
|
|
a major refactoring of the compiler tool chain that results in
|
|
|
|
faster builds, especially for large projects,
|
2014-04-07 22:07:17 -06:00
|
|
|
significant performance improvements across the board,
|
2014-04-18 13:40:55 -06:00
|
|
|
and support for Solaris, Plan 9 and Google's Native Client architecture (NaCl).
|
2014-04-08 16:19:35 -06:00
|
|
|
It also has an important refinement to the memory model regarding synchronization.
|
2014-03-25 20:56:16 -06:00
|
|
|
As always, Go 1.3 keeps the <a href="/doc/go1compat.html">promise
|
|
|
|
of compatibility</a>,
|
|
|
|
and almost everything
|
|
|
|
will continue to compile and run without change when moved to 1.3.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<h2 id="os">Changes to the supported operating systems and architectures</h2>
|
|
|
|
|
|
|
|
<h3 id="nacl">Support for Native Client</h3>
|
2014-04-08 20:47:35 -06:00
|
|
|
|
2014-03-25 20:56:16 -06:00
|
|
|
<p>
|
2014-04-08 20:47:35 -06:00
|
|
|
Support for the Native Client virtual machine architecture has returned to Go with the 1.3 release.
|
|
|
|
It runs on the 32-bit Intel architectures (<code>GOARCH=386</code>) and also on 64-bit Intel, but using
|
|
|
|
32-bit pointers (<code>GOARCH=amd64p32</code>).
|
|
|
|
There is not yet support for Native Client on ARM.
|
|
|
|
Note that this is Native Client (NaCl), not Portable Native Client (PNaCl).
|
|
|
|
Details about Native Client are <a href="https://developers.google.com/native-client/dev/">here</a>;
|
|
|
|
how to set up the Go version is described <a href="http://golang.org/wiki/NativeClient">here</a>.
|
2014-03-25 20:56:16 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<h3 id="solaris">Support for Solaris</h3>
|
|
|
|
|
|
|
|
<p>
|
2014-04-09 08:08:35 -06:00
|
|
|
Go 1.3 now includes experimental support for Solaris on the <code>amd64</code> (64-bit x86) architecture.
|
2014-03-25 20:56:16 -06:00
|
|
|
</p>
|
|
|
|
|
2014-04-18 13:40:55 -06:00
|
|
|
<h3 id="plan9">Support for Plan 9</h3>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
Go 1.3 now includes experimental support for Plan 9 on the <code>386</code> (32-bit x86) architecture.
|
|
|
|
</p>
|
2014-03-25 20:56:16 -06:00
|
|
|
|
2014-04-08 16:19:35 -06:00
|
|
|
<h3 id="win2000">Removal of support for Windows 2000</h3>
|
2014-03-25 20:56:16 -06:00
|
|
|
|
|
|
|
<p>
|
2014-04-07 22:07:17 -06:00
|
|
|
Microsoft stopped supporting Windows 2000 in 2010.
|
|
|
|
Since it has <a href="https://codereview.appspot.com/74790043">implementation difficulties</a>
|
|
|
|
regarding exception handling (signals in Unix terminology),
|
|
|
|
as of Go 1.3 it is not supported by Go either.
|
2014-03-25 20:56:16 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
|
2014-04-16 13:15:39 -06:00
|
|
|
<h3 id="freebsd">Support for FreeBSD</h3>
|
2014-04-16 11:40:41 -06:00
|
|
|
|
|
|
|
<p>
|
|
|
|
It was not announced at the time, but since the release of Go 1.2, support for Go on FreeBSD
|
|
|
|
requires FreeBSD 8 or above.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
As of Go 1.3, support for Go on FreeBSD requires that the kernel be compiled with the
|
|
|
|
<code>COMPAT_FREEBSD32</code> flag configured.
|
|
|
|
</p>
|
|
|
|
|
2014-03-25 20:56:16 -06:00
|
|
|
<h2 id="memory">Changes to the memory model</h2>
|
|
|
|
|
|
|
|
<p>
|
2014-03-26 18:45:51 -06:00
|
|
|
The Go 1.3 memory model <a href="https://codereview.appspot.com/75130045">adds a new rule</a>
|
|
|
|
concerning sending and receiving on buffered channels,
|
|
|
|
to make explicit that a buffered channel can be used as a simple
|
|
|
|
semaphore, using a send into the
|
|
|
|
channel to acquire and a receive from the channel to release.
|
|
|
|
This is not a language change, just a clarification about an expected property of communication.
|
2014-03-25 20:56:16 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<h2 id="impl">Changes to the implementations and tools</h2>
|
|
|
|
|
|
|
|
<h3 id="stacks">Stack</h3>
|
|
|
|
|
|
|
|
<p>
|
2014-03-27 19:55:37 -06:00
|
|
|
Go 1.3 has changed the implementation of goroutine stacks away from the old,
|
|
|
|
"segmented" model to a contiguous model.
|
|
|
|
When a goroutine needs more stack
|
|
|
|
than is available, its stack is transferred to a larger single block of memory.
|
|
|
|
The overhead of this transfer operation amortizes well and eliminates the old "hot spot"
|
|
|
|
problem when a calculation repeatedly steps across a segment boundary.
|
|
|
|
Details including performance numbers are in this
|
|
|
|
<a href="http://golang.org/s/contigstacks">design document</a>.
|
2014-03-25 20:56:16 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<h3 id="stack_size">Stack size</h3>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
Go 1.2 increased the minimum stack size to 8 kilobytes; with the new stack model, it has been
|
|
|
|
put back to 4 kilobytes.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<h3 id="garbage_collector">Changes to the garbage collector</h3>
|
|
|
|
|
|
|
|
<p>
|
2014-04-08 20:47:35 -06:00
|
|
|
For a while now, the garbage collector has been <em>precise</em> when examining
|
|
|
|
values in the heap; the Go 1.3 release adds equivalent precision to values on the stack.
|
|
|
|
This means that a non-pointer Go value such as an integer will never be mistaken for a
|
|
|
|
pointer and prevent unused memory from being reclaimed.
|
2014-03-25 20:56:16 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<h3 id="liblink">The linker</h3>
|
|
|
|
|
|
|
|
<p>
|
2014-04-08 16:19:35 -06:00
|
|
|
As part of the general <a href="http://golang.org/s/go13linker">overhaul</a> to
|
|
|
|
the Go linker, the compilers and linkers have been refactored.
|
|
|
|
The linker is still a C program, but now the instruction selection phase that
|
|
|
|
was part of the linker has been moved to the compiler through the creation of a new
|
|
|
|
library called <code>liblink</code>.
|
|
|
|
By doing instruction selection only once, when the package is first compiled,
|
|
|
|
this can speed up compilation of large projects significantly.
|
2014-03-25 20:56:16 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
2014-04-08 16:19:35 -06:00
|
|
|
<em>Updating</em>: Although this is a major internal change, it should have no
|
|
|
|
effect on programs.
|
2014-03-25 20:56:16 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<h3 id="gccgo">Status of gccgo</h3>
|
|
|
|
|
|
|
|
<p>
|
2014-04-08 17:45:39 -06:00
|
|
|
GCC release 4.9 will contain the Go 1.2 (not 1.3) version of gccgo.
|
|
|
|
The release schedules for the GCC and Go projects do not coincide,
|
|
|
|
which means that 1.3 will be available in the development branch but
|
|
|
|
that the next GCC release, 4.10, will likely have the Go 1.4 version of gccgo.
|
2014-03-25 20:56:16 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<h3 id="gocmd">Changes to the go command</h3>
|
|
|
|
|
|
|
|
<p>
|
2014-04-08 23:20:00 -06:00
|
|
|
The <a href="/cmd/go/"><code>cmd/go</code></a> command has several new
|
|
|
|
features.
|
|
|
|
The <a href="/cmd/go/"><code>go run</code></a> and
|
|
|
|
<a href="/cmd/go/"><code>go test</code></a> subcommands
|
|
|
|
support a new <code>-exec</code> option to specify an alternate
|
|
|
|
way to run the resulting binary.
|
|
|
|
Its immediate purpose is to support NaCl.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
The test coverage support of the <a href="/cmd/go/"><code>go test</code></a>
|
|
|
|
subcommand now automatically sets the coverage mode to <code>-atomic</code>
|
|
|
|
when the race detector is enabled, to eliminate false reports about unsafe
|
|
|
|
access to coverage counters.
|
|
|
|
</p>
|
|
|
|
|
2014-04-18 12:00:38 -06:00
|
|
|
<p>
|
|
|
|
The <a href="/cmd/go/"><code>go test</code></a> subcommand
|
|
|
|
now always builds the package, even if it has no test files.
|
|
|
|
Previously, it would do nothing if no test files were present.
|
|
|
|
</p>
|
|
|
|
|
2014-04-08 23:20:00 -06:00
|
|
|
<p>
|
|
|
|
Finally, the go command now supports packages that import Objective-C
|
|
|
|
files (suffixed <code>.m</code>) through cgo.
|
2014-03-25 20:56:16 -06:00
|
|
|
</p>
|
|
|
|
|
build: remove tmp dir names from objects, support GOROOT_FINAL again
If we compile a generated file stored in a temporary
directory - let's say /tmp/12345/work/x.c - then by default
6c stores the full path and then the pcln table in the
final binary includes the full path. This makes repeated builds
(using different temporary directories) produce different
binaries, even if the inputs are the same.
In the old 'go tool pack', the P flag specified a prefix to remove
from all stored paths (if present), and cmd/go invoked
'go tool pack grcP $WORK' to remove references to the
temporary work directory.
We've changed the build to avoid pack as much as possible,
under the theory that instead of making pack convert from
.6 to .a, the tools should just write the .a directly and save a
round of I/O.
Instead of going back to invoking pack always, define a common
flag -trimpath in the assemblers, C compilers, and Go compilers,
implemented in liblink, and arrange for cmd/go to use the flag.
Then the object files being written out have the shortened paths
from the start.
While we are here, reimplement pcln support for GOROOT_FINAL.
A build in /tmp/go uses GOROOT=/tmp/go, but if GOROOT_FINAL=/usr/local/go
is set, then a source file named /tmp/go/x.go is recorded instead as
/usr/local/go/x.go. We use this so that we can prepare distributions
to be installed in /usr/local/go without actually working in that
directory. The conversion to liblink deleted all the old file name
handling code, including the GOROOT_FINAL translation.
Bring the GOROOT_FINAL translation back.
Before this CL, using GOROOT_FINAL=/goroot make.bash:
g% strings $(which go) | grep -c $TMPDIR
6
g% strings $(which go) | grep -c $GOROOT
793
g%
After this CL:
g% strings $(which go) | grep -c $TMPDIR
0
g% strings $(which go) | grep -c $GOROOT
0
g%
(The references to $TMPDIR tend to be cgo-generated source files.)
Adding the -trimpath flag to the assemblers required converting
them to the new Go-semantics flag parser. The text in go1.3.html
is copied and adjusted from go1.1.html, which is when we applied
that conversion to the compilers and linkers.
Fixes #6989.
LGTM=iant
R=r, iant
CC=golang-codereviews
https://golang.org/cl/88300045
2014-04-15 18:46:46 -06:00
|
|
|
<h3 id="gc_flag">Command-line flag parsing</h3>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
In the gc tool chain, the assemblers now use the
|
|
|
|
same command-line flag parsing rules as the Go flag package, a departure
|
|
|
|
from the traditional Unix flag parsing. This may affect scripts that invoke
|
|
|
|
the tool directly.
|
|
|
|
For example,
|
|
|
|
<code>go tool 6a -SDfoo</code> must now be written
|
|
|
|
<code>go tool 6a -S -D foo</code>.
|
|
|
|
(The same change was made to the compilers and linkers in <a href="/doc/go1.1#gc_flag">Go 1.1</a>.)
|
|
|
|
</p>
|
|
|
|
|
2014-03-25 20:56:16 -06:00
|
|
|
<h3 id="misc">Miscellany</h3>
|
|
|
|
|
2014-04-08 16:19:35 -06:00
|
|
|
<p>
|
|
|
|
The program <code>misc/benchcmp</code> that compares
|
|
|
|
performance across benchmarking runs has been rewritten.
|
|
|
|
Once a shell and awk script in the main repository, it is now a Go program in the <code>go.tools</code> repo.
|
|
|
|
Documentation is <a href="http://godoc.org/code.google.com/p/go.tools/cmd/benchcmp">here</a>.
|
|
|
|
</p>
|
|
|
|
|
2014-04-08 23:20:00 -06:00
|
|
|
<p>
|
2014-04-08 16:19:35 -06:00
|
|
|
For the few of us that build Go distributions, the tool <code>misc/dist</code> has been
|
|
|
|
moved and renamed; it now lives in <code>misc/makerelease</code>, still in the main repository.
|
2014-04-08 23:20:00 -06:00
|
|
|
</p>
|
2014-03-25 20:56:16 -06:00
|
|
|
|
|
|
|
|
|
|
|
<h2 id="performance">Performance</h2>
|
|
|
|
|
|
|
|
<p>
|
2014-04-08 15:12:20 -06:00
|
|
|
The performance of Go binaries for this release has improved in many cases due to changes
|
|
|
|
in the runtime and garbage collection, plus some changes to libraries.
|
|
|
|
Significant instances include:
|
2014-03-25 20:56:16 -06:00
|
|
|
</p>
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
|
|
|
|
<li>
|
2014-04-08 15:12:20 -06:00
|
|
|
As mentioned above, the default stack size has been reduced from 8 kilobytes to 4 kilobytes.
|
2014-03-25 20:56:16 -06:00
|
|
|
</li>
|
|
|
|
|
2014-04-08 15:12:20 -06:00
|
|
|
<li>
|
|
|
|
The runtime handles defers more efficiently, reducing the memory footprint by about two kilobytes
|
|
|
|
per goroutine that calls defer.
|
|
|
|
</li>
|
2014-03-25 20:56:16 -06:00
|
|
|
|
2014-04-08 15:12:20 -06:00
|
|
|
<li>
|
|
|
|
The garbage collector has been sped up, using a concurrent sweep algorithm,
|
|
|
|
better parallelization, and larger pages.
|
|
|
|
The cumulative effect can be a 50-70% reduction in collector pause time.
|
|
|
|
</li>
|
2014-03-25 20:56:16 -06:00
|
|
|
|
2014-04-08 15:12:20 -06:00
|
|
|
<li>
|
|
|
|
The race detector (see <a href="http://golang.org/doc/articles/race_detector.html">this guide</a>)
|
|
|
|
is now about 40% faster.
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li>
|
|
|
|
The regular expression package <a href="/pkg/regexp/"><code>regexp</code></a>
|
2014-04-10 16:52:16 -06:00
|
|
|
is now significantly faster for certain simple expressions due to the implementation of
|
2014-04-08 15:12:20 -06:00
|
|
|
a second, one-pass execution engine. The choice of which engine to use is automatic;
|
|
|
|
the details are hidden from the user.
|
|
|
|
</li>
|
|
|
|
|
|
|
|
</ul>
|
2014-03-25 20:56:16 -06:00
|
|
|
|
2014-04-07 22:07:17 -06:00
|
|
|
<p>
|
2014-04-08 15:12:20 -06:00
|
|
|
Also, the runtime now includes in stack dumps how long a goroutine has been blocked,
|
|
|
|
which can be useful information when debugging deadlocks or performance issues.
|
2014-04-07 22:07:17 -06:00
|
|
|
</p>
|
|
|
|
|
2014-04-08 15:12:20 -06:00
|
|
|
<h2 id="library">Changes to the standard library</h2>
|
2014-03-25 20:56:16 -06:00
|
|
|
|
|
|
|
<h3 id="new_packages">New packages</h3>
|
|
|
|
|
|
|
|
<p>
|
2014-04-18 02:50:06 -06:00
|
|
|
A new package <a href="/pkg/debug/plan9obj/"><code>debug/plan9obj</code></a> was added to the standard library.
|
|
|
|
It implements access to Plan 9 <a href="http://plan9.bell-labs.com/magic/man2html/6/a.out">a.out</a> object files.
|
2014-03-25 20:56:16 -06:00
|
|
|
</p>
|
|
|
|
|
2014-04-08 15:12:20 -06:00
|
|
|
<h3 id="major_library_changes">Major changes to the library</h3>
|
|
|
|
|
2014-04-08 23:20:00 -06:00
|
|
|
<p>
|
|
|
|
A previous bug in <a href="/pkg/crypto/tls/"><code>crypto/tls</code></a>
|
2014-04-10 16:52:16 -06:00
|
|
|
made it possible to skip verification in TLS inadvertently.
|
2014-04-08 23:20:00 -06:00
|
|
|
In Go 1.3, the bug is fixed: one must specify either ServerName or
|
|
|
|
InsecureSkipVerify, and if ServerName is specified it is enforced.
|
|
|
|
This may break existing code that incorrectly depended on insecure
|
|
|
|
behavior.
|
|
|
|
</p>
|
|
|
|
|
2014-04-08 15:12:20 -06:00
|
|
|
<p>
|
|
|
|
There is an important new type added to the standard library: <a href="/pkg/sync/#Pool"><code>sync.Pool</code></a>.
|
|
|
|
It provides an efficient mechanism for implementing certain types of caches whose memory
|
|
|
|
can be reclaimed automatically by the system.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
2014-04-08 23:20:00 -06:00
|
|
|
The <a href="/pkg/testing/"><code>testing</code></a> package's benchmarking helper,
|
|
|
|
<a href="/pkg/testing/#B"><code>B</code></a>, now has a
|
|
|
|
<a href="/pkg/testing/#B.RunParallel"><code>RunParallel</code></a> method
|
|
|
|
to make it easier to run benchmarks that exercise multiple CPUs.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
<em>Updating</em>: The crypto/tls fix may break existing code, but such
|
|
|
|
code was erroneous and should be updated.
|
2014-04-08 15:12:20 -06:00
|
|
|
</p>
|
|
|
|
|
2014-03-25 20:56:16 -06:00
|
|
|
<h3 id="minor_library_changes">Minor changes to the library</h3>
|
|
|
|
|
|
|
|
<p>
|
|
|
|
The following list summarizes a number of minor changes to the library, mostly additions.
|
|
|
|
See the relevant package documentation for more information about each change.
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
|
2014-04-08 15:12:20 -06:00
|
|
|
<li>
|
|
|
|
The complex power function, <a href="/pkg/math/cmplx/#Pow"><code>Pow</code></a>,
|
|
|
|
now specifies the behavior when the first argument is zero. It was undefined before.
|
|
|
|
The details are in the <a href="/pkg/math/cmplx/#Pow">documentation for the function</a>.
|
|
|
|
</li>
|
|
|
|
|
2014-04-09 22:17:48 -06:00
|
|
|
<li> In the <a href="/pkg/crypto/tls/"><code>crypto/tls</code></a> package,
|
|
|
|
a new <a href="/pkg/crypto/tls/#DialWithDialer"><code>DialWithDialer</code></a>
|
|
|
|
function lets one establish a TLS connection using an existing dialer, making it easier
|
|
|
|
to control dial options such as timeouts.
|
|
|
|
The package also now reports the TLS version used by the connection in the
|
|
|
|
<a href="/pkg/crypto/tls/#ConnectionState"><code>ConnectionState</code></a>
|
|
|
|
struct.
|
|
|
|
</li>
|
2014-04-08 15:12:20 -06:00
|
|
|
|
2014-04-09 22:17:48 -06:00
|
|
|
<li> The <a href="/pkg/crypto/x509/#CreateCertificate"><code>CreateCertificate</code></a>
|
|
|
|
function of the <a href="/pkg/crypto/tls/"><code>crypto/tls</code></a> package
|
|
|
|
now supports parsing (and elsewhere, serialization) of PKCS #10 certificate
|
|
|
|
signature requests.
|
|
|
|
</li>
|
2014-04-08 15:12:20 -06:00
|
|
|
|
|
|
|
<li>
|
|
|
|
The formatted print functions of the <code>fmt</code> package now define <code>%F</code>
|
|
|
|
as a synonym for <code>%f</code> when printing floating-point values.
|
|
|
|
</li>
|
|
|
|
|
2014-04-08 20:46:33 -06:00
|
|
|
<li>
|
|
|
|
The <a href="/pkg/net/http/"><code>net/http</code></a> package now exposes the
|
2014-04-10 16:09:59 -06:00
|
|
|
properties of a TLS connection used to make a client request in the new
|
2014-04-08 20:46:33 -06:00
|
|
|
<a href="/pkg/net/http/#Response"><code>Response.TLS</code></a> field.
|
|
|
|
</li>
|
2014-04-08 15:12:20 -06:00
|
|
|
|
2014-04-08 20:46:33 -06:00
|
|
|
<li>
|
|
|
|
The <a href="/pkg/net/http/"><code>net/http</code></a> package now
|
|
|
|
allows setting an optional server error logger
|
|
|
|
with <a href="/pkg/net/http/#Server"><code>Server.ErrorLog</code></a>.
|
|
|
|
The default is still that all errors go to stderr.
|
|
|
|
</li>
|
2014-04-08 15:12:20 -06:00
|
|
|
|
2014-04-10 16:09:59 -06:00
|
|
|
<li>
|
|
|
|
The <a href="/pkg/net/http/"><code>net/http</code></a> package now
|
|
|
|
supports disabling HTTP keep-alive connections on the server
|
|
|
|
with <a href="/pkg/net/http/#Server.SetKeepAlivesEnabled"><code>Server.SetKeepAlivesEnabled</code></a>.
|
|
|
|
The default continues to be that the server does keep-alive (reuses
|
|
|
|
connections for multiple requests) by default. Only
|
|
|
|
resource-constrained servers or those in the process of graceful
|
|
|
|
shutdown will want to disable them.
|
|
|
|
</li>
|
2014-04-08 15:12:20 -06:00
|
|
|
|
2014-04-10 16:09:59 -06:00
|
|
|
<li>
|
|
|
|
The <a href="/pkg/net/http/"><code>net/http</code></a> package adds an optional
|
|
|
|
<a href="/pkg/net/http/#Transport"><code>Transport.TLSHandshakeTimeout</code></a>
|
|
|
|
setting to cap the amount of time HTTP client requests will wait for
|
|
|
|
TLS handshakes to complete. It's now also set by default
|
|
|
|
on <a href="/pkg/net/http#DefaultTransport"><code>DefaultTransport</code></a>.
|
|
|
|
</li>
|
2014-04-08 15:12:20 -06:00
|
|
|
|
2014-04-10 16:09:59 -06:00
|
|
|
<li>
|
|
|
|
The <a href="/pkg/net/http/"><code>net/http</code></a> package's
|
|
|
|
<a href="/pkg/net/http/#DefaultTransport"><code>DefaultTransport</code></a>,
|
|
|
|
used by the HTTP client code, now
|
|
|
|
enables <a href="http://en.wikipedia.org/wiki/Keepalive#TCP_keepalive">TCP
|
|
|
|
keep-alives</a> by
|
|
|
|
default. Other <a href="/pkg/net/http/#Transport"><code>Transport</code></a>
|
|
|
|
values with a nil <code>Dial</code> field continue to function the same
|
|
|
|
as before: no TCP keep-alives are used.
|
|
|
|
</li>
|
2014-04-08 15:12:20 -06:00
|
|
|
|
2014-04-10 16:09:59 -06:00
|
|
|
<li>
|
|
|
|
The <a href="/pkg/net/http/"><code>net/http</code></a> package
|
|
|
|
now enables <a href="http://en.wikipedia.org/wiki/Keepalive#TCP_keepalive">TCP
|
|
|
|
keep-alives</a> for incoming server requests when
|
|
|
|
<a href="/pkg/net/http/#ListenAndServe"><code>ListenAndServe</code></a>
|
|
|
|
or
|
|
|
|
<a href="/pkg/net/http/#ListenAndServeTLS"><code>ListenAndServeTLS</code></a>
|
|
|
|
are used. When a server is started otherwise, TCP keep-alives are not enabled.
|
|
|
|
</li>
|
2014-04-08 15:12:20 -06:00
|
|
|
|
2014-04-10 16:09:59 -06:00
|
|
|
<li>
|
|
|
|
The <a href="/pkg/net/http/"><code>net/http</code></a> package now
|
|
|
|
provides an
|
|
|
|
optional <a href="/pkg/net/http/#Server"><code>Server.ConnState</code></a>
|
|
|
|
callback to hook various phases of a server connection's lifecycle
|
|
|
|
(see <a href="/pkg/net/http/#ConnState"><code>ConnState</code></a>). This
|
|
|
|
can be used to implement rate limiting or graceful shutdown.
|
|
|
|
</li>
|
|
|
|
|
|
|
|
<li>
|
|
|
|
The <a href="/pkg/net/http/"><code>net/http</code></a> package's HTTP
|
|
|
|
client now has an
|
|
|
|
optional <a href="/pkg/net/http/#Client"><code>Client.Timeout</code></a>
|
|
|
|
field to specify an end-to-end timeout on requests made using the
|
|
|
|
client.
|
|
|
|
</li>
|
2014-04-08 15:12:20 -06:00
|
|
|
|
2014-04-09 22:17:48 -06:00
|
|
|
<li> In the <a href="/pkg/net/"><code>net</code></a> package,
|
|
|
|
the <a href="/pkg/net/#Dialer"><code>Dialer</code></a> struct now
|
|
|
|
has a <code>KeepAlive</code> option to specify a keep-alive period for the connection.
|
|
|
|
</li>
|
2014-04-08 15:12:20 -06:00
|
|
|
|
2014-04-14 11:19:10 -06:00
|
|
|
<li>
|
|
|
|
The <a href="/pkg/net/http/"><code>net/http</code></a> package's
|
|
|
|
<a href="/pkg/net/http/#Transport"><code>Transport</code></a>
|
|
|
|
now closes <a href="/pkg/net/http/#Request"><code>Request.Body</code></a>
|
2014-04-14 17:28:52 -06:00
|
|
|
consistently, even on error.
|
2014-04-14 11:19:10 -06:00
|
|
|
</li>
|
|
|
|
|
2014-04-08 15:12:20 -06:00
|
|
|
<li>
|
|
|
|
The <a href="/pkg/os/exec/"><code>os/exec</code></a> package now implements
|
|
|
|
what the documentation has always said with regard to relative paths for the binary.
|
|
|
|
In particular, it only calls <a href="/pkg/os/exec/#LookPath"><code>LookPath</code></a>
|
|
|
|
when the binary's file name contains no path separators.
|
|
|
|
</li>
|
|
|
|
|
runtime: crash when func main calls Goexit and all other goroutines exit
This has typically crashed in the past, although usually with
an 'all goroutines are asleep - deadlock!' message that shows
no goroutines (because there aren't any).
Previous discussion at:
https://groups.google.com/d/msg/golang-nuts/uCT_7WxxopQ/BoSBlLFzUTkJ
https://groups.google.com/d/msg/golang-dev/KUojayEr20I/u4fp_Ej5PdUJ
http://golang.org/issue/7711
There is general agreement that runtime.Goexit terminates the
main goroutine, so that main cannot return, so the program does
not exit.
The interpretation that all other goroutines exiting causes an
exit(0) is relatively new and was not part of those discussions.
That is what this CL changes.
Thankfully, even though the exit(0) has been there for a while,
some other accounting bugs made it very difficult to trigger,
so it is reasonable to replace. In particular, see golang.org/issue/7711#c10
for an examination of the behavior across past releases.
Fixes #7711.
LGTM=iant, r
R=golang-codereviews, iant, dvyukov, r
CC=golang-codereviews
https://golang.org/cl/88210044
2014-04-16 11:12:18 -06:00
|
|
|
<li>
|
|
|
|
If the main goroutine calls
|
2014-04-20 12:29:17 -06:00
|
|
|
<a href="/pkg/runtime/#Goexit"><code>runtime.Goexit</code></a>
|
runtime: crash when func main calls Goexit and all other goroutines exit
This has typically crashed in the past, although usually with
an 'all goroutines are asleep - deadlock!' message that shows
no goroutines (because there aren't any).
Previous discussion at:
https://groups.google.com/d/msg/golang-nuts/uCT_7WxxopQ/BoSBlLFzUTkJ
https://groups.google.com/d/msg/golang-dev/KUojayEr20I/u4fp_Ej5PdUJ
http://golang.org/issue/7711
There is general agreement that runtime.Goexit terminates the
main goroutine, so that main cannot return, so the program does
not exit.
The interpretation that all other goroutines exiting causes an
exit(0) is relatively new and was not part of those discussions.
That is what this CL changes.
Thankfully, even though the exit(0) has been there for a while,
some other accounting bugs made it very difficult to trigger,
so it is reasonable to replace. In particular, see golang.org/issue/7711#c10
for an examination of the behavior across past releases.
Fixes #7711.
LGTM=iant, r
R=golang-codereviews, iant, dvyukov, r
CC=golang-codereviews
https://golang.org/cl/88210044
2014-04-16 11:12:18 -06:00
|
|
|
and all other goroutines finish execution, the program now always crashes,
|
|
|
|
reporting a detected deadlock.
|
|
|
|
Earlier versions of Go handled this situation inconsistently: most instances
|
|
|
|
were reported as deadlocks, but some trivial cases exited cleanly instead.
|
|
|
|
</li>
|
|
|
|
|
2014-04-08 15:12:20 -06:00
|
|
|
<li>
|
|
|
|
The <a href="/pkg/strconv/#CanBackquote"><code>CanBackquote</code></a>
|
|
|
|
function in the <a href="/pkg/strconv/"><code>strconv</code></a> package
|
|
|
|
now considers the <code>DEL</code> character, <code>U+007F</code>, to be
|
|
|
|
non-printing.
|
|
|
|
</li>
|
|
|
|
|
2014-04-11 22:56:17 -06:00
|
|
|
<li>
|
|
|
|
On Windows, the <a href="/pkg/syscall/"><code>syscall</code></a> package now
|
|
|
|
supports the cdecl calling convention through the addition of a new function
|
|
|
|
<a href="/pkg/syscall/#NewCallbackCDecl"><code>NewCallbackCDecl</code></a>
|
|
|
|
alongside the existing function
|
|
|
|
<a href="/pkg/syscall/#NewCallback"><code>NewCallback</code></a>.
|
|
|
|
</li>
|
2014-04-08 15:12:20 -06:00
|
|
|
|
|
|
|
<li>
|
|
|
|
The <a href="/pkg/testing/"><code>testing</code></a> package now
|
2014-04-08 16:19:35 -06:00
|
|
|
diagnoses tests that call <code>panic(nil)</code>, which are almost always erroneous.
|
2014-04-08 15:12:20 -06:00
|
|
|
</li>
|
|
|
|
|
|
|
|
<li>
|
|
|
|
The <a href="/pkg/unicode/"><code>unicode</code></a> package and associated
|
|
|
|
support throughout the system has been upgraded from
|
|
|
|
Unicode 6.2.0 to <a href="http://www.unicode.org/versions/Unicode6.3.0/">Unicode 6.3.0</a>.
|
|
|
|
</li>
|
|
|
|
|
2014-03-25 20:56:16 -06:00
|
|
|
</ul>
|