2018-06-11 11:36:05 -06:00
<!-- {
"Title": "Go 1.11 Release Notes",
"Path": "/doc/go1.11",
"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.11< / h2 >
< p >
< strong >
Go 1.11 is not yet released. These are work-in-progress
release notes. Go 1.11 is expected to be released in August 2018.
< / strong >
< / p >
< p >
The latest Go release, version 1.11, arrives six months after < a href = "go1.10" > Go 1.10< / a > .
Most of its 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.
< / p >
< h2 id = "language" > Changes to the language< / h2 >
< p >
There are no changes to the language specification.
< / p >
< h2 id = "ports" > Ports< / h2 >
2018-07-16 12:37:13 -06:00
< p > <!-- CL 94255, CL 115038, etc -->
2018-06-11 11:36:05 -06:00
As < a href = "go1.10#ports" > announced in the Go 1.10 release notes< / a > , Go 1.11 now requires
OpenBSD 6.2 or later, macOS 10.10 Yosemite or later, or Windows 7 or later;
2018-07-18 15:57:36 -06:00
support for previous versions of these operating systems has been removed.
2018-06-11 11:36:05 -06:00
< / p >
2018-07-17 15:49:37 -06:00
< p > <!-- CL 121657 -->
Go 1.11 supports the upcoming OpenBSD 6.4 release. Due to changes in
the OpenBSD kernel, older versions of Go will not work on OpenBSD 6.4.
< / p >
2018-06-11 11:36:05 -06:00
< p >
There are < a href = "https://golang.org/issue/25206" > known issues< / a > with NetBSD on i386 hardware.
< / p >
< p > <!-- CL 107935 -->
2018-07-16 12:22:26 -06:00
The race detector is now supported on < code > linux/ppc64le< / code >
and, to a lesser extent, on < code > netbsd/amd64< / code > . The NetBSD race detector support
has < a href = "https://golang.org/issue/26403" > known issues< / a > .
2018-06-11 11:36:05 -06:00
< / p >
2018-07-17 15:49:37 -06:00
< p > <!-- CL 109255 -->
The memory sanitizer (< code > -msan< / code > ) is now supported on < code > linux/arm64< / code > .
< / p >
2018-07-16 12:37:13 -06:00
< p > <!-- CL 93875 -->
The build modes < code > c-shared< / code > and < code > c-archive< / code > are now supported on
< code > freebsd/amd64< / code > .
< / p >
< p id = "mips" > <!-- CL 108475 -->
On 64-bit MIPS systems, the new environment variable settings
< code > GOMIPS64=hardfloat< / code > (the default) and
< code > GOMIPS64=softfloat< / code > select whether to use
hardware instructions or software emulation for floating-point computations.
For 32-bit systems, the environment variable is still < code > GOMIPS< / code > ,
as < a href = "go1.10#mips" > added in Go 1.10< / a > .
< / p >
2018-07-17 15:49:37 -06:00
< p > <!-- CL 107475 -->
On soft-float ARM systems (< code > GOARM=5< / code > ), Go now uses a more
efficient software floating point interface. This is transparent to
Go code, but ARM assembly that uses floating-point instructions not
guarded on GOARM will break and must be ported to
the < a href = "https://golang.org/cl/107475" > new interface< / a > .
< / p >
< p > <!-- CL 94076 -->
Go 1.11 on ARMv7 no longer requires a Linux kernel configured
with < code > KUSER_HELPERS< / code > . This setting is enabled in default
kernel configurations, but is sometimes disabled in stripped-down
configurations.
< / p >
2018-07-05 20:29:34 -06:00
< h3 id = "wasm" > WebAssembly< / h3 >
< p >
Go 1.11 adds an experimental port to WebAssembly (< code > js/wasm< / code > ).
< / p >
2018-07-16 11:05:59 -06:00
< p >
Go programs currently compile to one WebAssembly module that
includes the Go runtime for goroutine scheduling, garbage
collection, maps, etc.
As a result, the resulting size is at minimum around
2 MB, or 500 KB compressed. Go programs can call into JavaScript
using the new experimental
< a href = "/pkg/syscall/js/" > < code > syscall/js< / code > < / a > package.
Binary size and interop with other languages has not yet been a
priority but may be addressed in future releases.
< / p >
2018-07-11 15:30:09 -06:00
< p >
As a result of the addition of the new < code > GOOS< / code > value
"< code > js< / code > " and < code > GOARCH< / code > value "< code > wasm< / code > ",
Go files named < code > *_js.go< / code > or < code > *_wasm.go< / code > will
now be < a href = "/pkg/go/build/#hdr-Build_Constraints" > ignored by Go
tools< / a > except when those GOOS/GOARCH values are being used.
2018-07-11 19:37:17 -06:00
If you have existing filenames matching those patterns, you will need to rename them.
2018-07-11 15:30:09 -06:00
< / p >
2018-07-05 20:29:34 -06:00
2018-07-18 10:20:49 -06:00
< h3 id = "riscv" > RISC-V GOARCH values reserved< / h3 >
< p > <!-- CL 106256 -->
2018-07-18 14:20:56 -06:00
The main Go compiler does not yet support the RISC-V architecture <!-- is gonna change everything -->
2018-07-18 10:20:49 -06:00
but we've reserved the < code > GOARCH< / code > values
"< code > riscv< / code > " and "< code > riscv64< / code > ", as used by Gccgo,
which does support RISC-V. This means that Go files
named < code > *_riscv.go< / code > will now also
be < a href = "/pkg/go/build/#hdr-Build_Constraints" > ignored by Go
tools< / a > except when those GOOS/GOARCH values are being used.
< / p >
2018-07-05 20:29:34 -06:00
< h2 id = "tools" > Tools< / h2 >
< h3 id = "modules" > Modules, package versioning, and dependency management< / h3 >
2018-06-25 11:48:59 -06:00
< p >
2018-07-18 12:27:20 -06:00
Go 1.11 adds preliminary support for a < a href = "/cmd/go/#hdr-Modules__module_versions__and_more" > new concept called “modules,”< / a >
2018-07-05 20:29:34 -06:00
an alternative to GOPATH with integrated support for versioning and
package distribution.
Using modules, developers are no longer confined to working inside GOPATH,
version dependency information is explicit yet lightweight,
and builds are more reliable and reproducible.
2018-06-25 11:48:59 -06:00
< / p >
2018-06-11 11:36:05 -06:00
< p >
2018-07-05 20:29:34 -06:00
Module support is considered experimental.
Details are likely to change in response to feedback from Go 1.11 users,
and we have more tools planned.
Although the details of module support may change, projects that convert
to modules using Go 1.11 will continue to work with Go 1.12 and later.
If you encounter bugs using modules,
please < a href = "https://golang.org/issue/new" > file issues< / a >
so we can fix them.
< / p >
2018-07-10 15:14:14 -06:00
< h3 id = "importpath" > Import path restriction< / h3 >
< p >
Because Go module support assigns special meaning to the
< code > @< / code > symbol in command line operations,
the < code > go< / code > command now disallows the use of
import paths containing < code > @< / code > symbols.
Such import paths were never allowed by < code > go< / code > < code > get< / code > ,
so this restriction can only affect users building
custom GOPATH trees by other means.
< / p >
2018-07-17 15:27:26 -06:00
< h3 id = "gopackages" > Package loading< / h3 >
2018-07-05 20:29:34 -06:00
< p >
TODO: Note about go/build versus golang.org/x/tools/go/packages.
< / p >
2018-07-17 15:27:26 -06:00
< h3 id = "gocache" > Build cache requirement< / h3 >
2018-07-05 20:29:34 -06:00
< p >
Go 1.11 will be the last release to support setting the environment
variable < code > GOCACHE=off< / code > to disable the
< a href = "/cmd/go/#hdr-Build_and_test_caching" > build cache< / a > ,
introduced in Go 1.10.
Starting in Go 1.12, the build cache will be required,
as a step toward eliminating < code > $GOPATH/pkg< / code > .
The module and package loading support described above
already require that the build cache be enabled.
If you have disabled the build cache to avoid problems you encountered,
please < a href = "https://golang.org/issue/new" > file an issue< / a > to let us know about them.
2018-06-11 11:36:05 -06:00
< / p >
2018-07-17 15:49:37 -06:00
< h3 id = "compiler" > Compiler toolchain< / h3 >
< p > <!-- CL 109918 -->
More functions are now eligible for inlining by default, including
functions that call < code > panic< / code > .
< / p >
< p > <!-- CL 97375 -->
The compiler toolchain now supports column information
in < a href = "/cmd/compile/#hdr-Compiler_Directives" > line
directives< / a > .
< / p >
< p > <!-- CL 106797 -->
A new package export data format has been introduced.
This should be transparent to end users, except for speeding up
build times for large Go projects.
If it does cause problems, it can be turned off again by
passing < code > -gcflags=all=-iexport=false< / code > to
the < code > go< / code > tool when building a binary.
< / p >
< p > <!-- CL 100459 -->
The compiler now rejects unused variables declared in a type switch
guard, such as < code > x< / code > in the following example:
< / p >
< pre >
func f(v interface{}) {
switch x := v.(type) {
}
}
< / pre >
< p >
This was already rejected by both < code > gccgo< / code >
and < a href = "/pkg/go/types/" > go/types< / a > .
< / p >
< h3 id = "assembler" > Assembler< / h3 >
< p > <!-- CL 113315 -->
The assembler for < code > amd64< / code > now accepts AVX512 instructions.
< / p >
< h3 id = "debugging" > Debugging< / h3 >
< p > <!-- CL 100738, CL 93664 -->
The compiler now produces significantly more accurate debug
information for optimized binaries, including variable location
information, line numbers, and breakpoint locations.
This should make it possible to debug binaries
compiled < em > without< / em > < code > -N< / code > < code > -l< / code > .
There are still limitations to the quality of the debug information,
some of which are fundamental, and some of which will continue to
improve with future releases.
< / p >
< p > <!-- CL 118276 -->
DWARF sections are now compressed by default because of the expanded
and more accurate debug information produced by the compiler.
This is transparent to most ELF tools (such as debuggers on Linux
and *BSD) and is supported by the Delve debugger on all platforms,
but has limited support in the native tools on macOS and Windows.
To disable DWARF compression,
pass < code > -ldflags=-compressdwarf=false< / code > to
the < code > go< / code > tool when building a binary.
< / p >
< p > <!-- CL 109699 -->
Go 1.11 adds experimental support for calling Go functions from
within a debugger.
This is useful, for example, to call < code > String< / code > methods
when paused at a breakpoint.
<!-- TODO(austin): Make sure methods calls are actually supported by Delve -->
This is currently only supported by Delve.
< / p >
doc/go1.11: explain new vet typechecking behaviour in release notes
Since Go1.10, go test runs vet on the tests before executing them.
Moreover, the vet tool typechecks the package under analysis with
go/types before running. In Go1.10, a typechecking failure just caused
a warning to be printed. In Go1.11, a typechecking failure will cause
vet to exit with a fatal error (see Issue #21287).
This means that starting with Go1.11, tests that don't typecheck will
fail immediately. This would not normally be an issue, since a test
that doesn't typecheck shouldn't even compile, and it should already
be broken.
Unfortunately, there's a bug in gc that makes it accept programs with
unused variables inside a closure (Issue #3059). This means that a
test with an unused variable inside a closure, that compiled and
passed in Go1.10, will fail in the typechecking step of vet starting
with Go1.11.
Explain this in the 1.11 release notes.
Fixes #26109
Change-Id: I970c1033ab6bc985d8c64bd24f56e854af155f96
Reviewed-on: https://go-review.googlesource.com/121455
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-06-28 12:22:13 -06:00
< h2 id = "tools" > Tools< / h2 >
< h3 id = "test" > Test< / h3 >
< p >
2018-07-17 15:27:26 -06:00
Since Go 1.10, the < code > go< / code > < code > test< / code > command runs
doc/go1.11: explain new vet typechecking behaviour in release notes
Since Go1.10, go test runs vet on the tests before executing them.
Moreover, the vet tool typechecks the package under analysis with
go/types before running. In Go1.10, a typechecking failure just caused
a warning to be printed. In Go1.11, a typechecking failure will cause
vet to exit with a fatal error (see Issue #21287).
This means that starting with Go1.11, tests that don't typecheck will
fail immediately. This would not normally be an issue, since a test
that doesn't typecheck shouldn't even compile, and it should already
be broken.
Unfortunately, there's a bug in gc that makes it accept programs with
unused variables inside a closure (Issue #3059). This means that a
test with an unused variable inside a closure, that compiled and
passed in Go1.10, will fail in the typechecking step of vet starting
with Go1.11.
Explain this in the 1.11 release notes.
Fixes #26109
Change-Id: I970c1033ab6bc985d8c64bd24f56e854af155f96
Reviewed-on: https://go-review.googlesource.com/121455
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-06-28 12:22:13 -06:00
< code > go< / code > < code > vet< / code > on the package being tested,
to identify problems before running the test. Since < code > vet< / code >
typechecks the code with < a href = "/pkg/go/types/" > go/types< / a >
before running, tests that do not typecheck will now fail.
In particular, tests that contain an unused variable inside a
2018-07-18 02:53:44 -06:00
closure compiled with Go 1.10, because the Go compiler incorrectly
doc/go1.11: explain new vet typechecking behaviour in release notes
Since Go1.10, go test runs vet on the tests before executing them.
Moreover, the vet tool typechecks the package under analysis with
go/types before running. In Go1.10, a typechecking failure just caused
a warning to be printed. In Go1.11, a typechecking failure will cause
vet to exit with a fatal error (see Issue #21287).
This means that starting with Go1.11, tests that don't typecheck will
fail immediately. This would not normally be an issue, since a test
that doesn't typecheck shouldn't even compile, and it should already
be broken.
Unfortunately, there's a bug in gc that makes it accept programs with
unused variables inside a closure (Issue #3059). This means that a
test with an unused variable inside a closure, that compiled and
passed in Go1.10, will fail in the typechecking step of vet starting
with Go1.11.
Explain this in the 1.11 release notes.
Fixes #26109
Change-Id: I970c1033ab6bc985d8c64bd24f56e854af155f96
Reviewed-on: https://go-review.googlesource.com/121455
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-06-28 12:22:13 -06:00
accepted them (< a href = "https://golang.org/issues/3059" > Issue #3059< / a > ),
but will now fail, since < code > go/types< / code > correctly reports an
"unused variable" error in this case.
< / p >
2018-07-17 15:49:37 -06:00
< p > <!-- CL 102696 -->
The < code > -memprofile< / code > flag
to < code > go< / code > < code > test< / code > now defaults to the
"allocs" profile, which records the total bytes allocated since the
test began (including garbage-collected bytes).
< / p >
doc/go1.11: explain new vet typechecking behaviour in release notes
Since Go1.10, go test runs vet on the tests before executing them.
Moreover, the vet tool typechecks the package under analysis with
go/types before running. In Go1.10, a typechecking failure just caused
a warning to be printed. In Go1.11, a typechecking failure will cause
vet to exit with a fatal error (see Issue #21287).
This means that starting with Go1.11, tests that don't typecheck will
fail immediately. This would not normally be an issue, since a test
that doesn't typecheck shouldn't even compile, and it should already
be broken.
Unfortunately, there's a bug in gc that makes it accept programs with
unused variables inside a closure (Issue #3059). This means that a
test with an unused variable inside a closure, that compiled and
passed in Go1.10, will fail in the typechecking step of vet starting
with Go1.11.
Explain this in the 1.11 release notes.
Fixes #26109
Change-Id: I970c1033ab6bc985d8c64bd24f56e854af155f96
Reviewed-on: https://go-review.googlesource.com/121455
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-06-28 12:22:13 -06:00
< h3 id = "vet" > Vet< / h3 >
< p > <!-- CL 108555 -->
The < a href = "/cmd/vet/" > < code > go< / code > < code > vet< / code > < / a >
command now reports a fatal error when the package under analysis
does not typecheck. Previously, a type checking error simply caused
a warning to be printed, and < code > vet< / code > to exit with status 1.
< / p >
2018-07-18 14:09:06 -06:00
< h3 id = "trace" > Trace< / h3 >
< p > <!-- CL 63274 -->
With the new < code > runtime/trace< / code >
package's < a href = "/pkg/runtime/trace/#hdr-User_annotation" > user
annotation API< / a > , users can record application-level information
in execution traces and create groups of related goroutines.
The < code > go< / code > < code > tool< / code > < code > trace< / code >
command visualizes this information in the trace view and the new
2018-07-18 14:26:13 -06:00
user task/region analysis page.
2018-07-18 14:09:06 -06:00
< / p >
2018-07-17 15:49:37 -06:00
< h2 id = "runtime" > Runtime< / h2 >
< p > <!-- CL 85887 -->
The runtime now uses a sparse heap layout so there is no longer a
limit to the size of the Go heap (previously, the limit was 512GiB).
This also fixes rare "address space conflict" failures in mixed Go/C
binaries or binaries compiled with < code > -race< / code > .
< / p >
2018-07-18 13:35:12 -06:00
< p > <!-- CL 108679, CL 106156 -->
2018-07-18 01:17:19 -06:00
On macOS and iOS, the runtime now uses < code > libSystem.so< / code > instead of
2018-07-17 15:49:37 -06:00
calling the kernel directly. This should make Go binaries more
2018-07-18 01:17:19 -06:00
compatible with future versions of macOS and iOS.
2018-07-17 15:49:37 -06:00
The < a href = "/pkg/syscall" > syscall< / a > package still makes direct
system calls; fixing this is planned for a future release.
< / p >
doc/go1.11: explain new vet typechecking behaviour in release notes
Since Go1.10, go test runs vet on the tests before executing them.
Moreover, the vet tool typechecks the package under analysis with
go/types before running. In Go1.10, a typechecking failure just caused
a warning to be printed. In Go1.11, a typechecking failure will cause
vet to exit with a fatal error (see Issue #21287).
This means that starting with Go1.11, tests that don't typecheck will
fail immediately. This would not normally be an issue, since a test
that doesn't typecheck shouldn't even compile, and it should already
be broken.
Unfortunately, there's a bug in gc that makes it accept programs with
unused variables inside a closure (Issue #3059). This means that a
test with an unused variable inside a closure, that compiled and
passed in Go1.10, will fail in the typechecking step of vet starting
with Go1.11.
Explain this in the 1.11 release notes.
Fixes #26109
Change-Id: I970c1033ab6bc985d8c64bd24f56e854af155f96
Reviewed-on: https://go-review.googlesource.com/121455
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2018-06-28 12:22:13 -06:00
2018-07-18 13:45:56 -06:00
< 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 better generated code and
optimizations in the core library.
< / p >
2018-07-18 15:57:36 -06:00
< p > <!-- CL 74851 -->
There were multiple performance changes to the < code > math/big< / code >
package as well as many changes across the tree specific to < code > GOARCH=arm64< / code > .
< / p >
2018-07-18 13:45:56 -06:00
< h3 id = "performance-compiler" > Compiler toolchain< / h3 >
< p > <!-- CL 110055 -->
The compiler now optimizes map clearing operations of the form:
< / p >
< pre >
for k := range m {
delete(m, k)
}
< / pre >
< p > <!-- CL 109517 -->
The compiler now optimizes slice extension of the form
< code > append(s,< / code > < code > make([]T,< / code > < code > n)...)< / code > .
< / p >
< p > <!-- CL 100277, CL 105635, CL 109776 -->
The compiler now performs significantly more aggressive bounds-check
and branch elimination. Notably, it now recognizes transitive
relations, so if < code > i< j< / code > and < code > j< len(s)< / code > ,
it can use these facts to eliminate the bounds check
for < code > s[i]< / code > . It also understands simple arithmetic such
as < code > s[i-10]< / code > and can recognize more inductive cases in
loops. Furthermore, the compiler now uses bounds information to more
aggressively optimize shift operations.
< / p >
2018-06-11 11:36:05 -06:00
< h2 id = "library" > Core library< / h2 >
< p >
All of the changes to the standard library are minor.
< / 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 >
2018-07-16 08:22:18 -06:00
<!-- CL 115095: https://golang.org/cl/115095: yes (`go test pkg` now always builds pkg even if there are no test files): cmd/go: output coverage report even if there are no test files -->
2018-06-11 11:36:05 -06:00
<!-- CL 110395: https://golang.org/cl/110395: cmd/go, cmd/compile: use Windows response files to avoid arg length limits -->
<!-- CL 112436: https://golang.org/cl/112436: cmd/pprof: add readline support similar to upstream -->
< dl id = "crypto" > < dt > < a href = "/pkg/crypto/" > crypto< / a > < / dt >
< dd >
< p > <!-- CL 64451 -->
2018-07-16 14:25:06 -06:00
Certain crypto operations, including
2018-07-16 16:14:58 -06:00
< a href = "/pkg/crypto/ecdsa/#Sign" > < code > ecdsa.Sign< / code > < / a > ,
< a href = "/pkg/crypto/rsa/#EncryptPKCS1v15" > < code > rsa.EncryptPKCS1v15< / code > < / a > and
< a href = "/pkg/crypto/rsa/#GenerateKey" > < code > rsa.GenerateKey< / code > < / a > ,
2018-07-16 14:25:06 -06:00
now randomly read an extra byte of randomness to ensure tests don't rely on internal behavior.
2018-06-11 11:36:05 -06:00
< / p >
< / dl > <!-- crypto -->
< dl id = "crypto/cipher" > < dt > < a href = "/pkg/crypto/cipher/" > crypto/cipher< / a > < / dt >
< dd >
< p > <!-- CL 48510, CL 116435 -->
2018-07-16 16:14:58 -06:00
The new function < a href = "/pkg/crypto/cipher/#NewGCMWithTagSize" > < code > NewGCMWithTagSize< / code > < / a >
2018-07-16 14:25:06 -06:00
implements Galois Counter Mode with non-standard tag lengths for compatibility with existing cryptosystems.
2018-06-11 11:36:05 -06:00
< / p >
< / dl > <!-- crypto/cipher -->
< dl id = "crypto/rsa" > < dt > < a href = "/pkg/crypto/rsa/" > crypto/rsa< / a > < / dt >
< dd >
< p > <!-- CL 103876 -->
2018-07-16 14:25:06 -06:00
< a href = "/pkg/crypto/rsa/#PublicKey" > < code > PublicKey< / code > < / a > now implements a
< a href = "/pkg/crypto/rsa/#PublicKey.Size" > < code > Size< / code > < / a > method that
returns the modulus size in bytes.
2018-06-11 11:36:05 -06:00
< / p >
< / dl > <!-- crypto/rsa -->
2018-07-16 14:25:06 -06:00
< dl id = "crypto/tls" > < dt > < a href = "/pkg/crypto/tls/" > crypto/tls< / a > < / dt >
< dd >
< p > <!-- CL 85115 -->
< a href = "/pkg/crypto/tls/#ConnectionState" > < code > ConnectionState< / code > < / a > 's new
< code > ExportKeyingMaterial< / code > field allows exporting keying material bound to the
connection according to RFC 5705.
< / p >
< / dl > <!-- crypto/tls -->
< dl id = "crypto/x509" > < dt > < a href = "/pkg/crypto/x509/" > crypto/x509< / a > < / dt >
< dd >
< p > <!-- CL 123355, CL 123695 -->
2018-07-16 16:14:58 -06:00
The deprecated, legacy behavior of treating the < code > CommonName< / code > field as
2018-07-16 14:25:06 -06:00
a hostname when no Subject Alternative Names are present is now disabled when the CN is not a
valid hostname.
2018-07-16 16:14:58 -06:00
The < code > CommonName< / code > can be completely ignored by adding the experimental value
2018-07-16 14:25:06 -06:00
< code > x509ignoreCN=1< / code > to the < code > GODEBUG< / code > environment variable.
When the CN is ignored, certificates without SANs validate under chains with name constraints
instead of returning < code > NameConstraintsWithoutSANs< / code > .
< / p >
< p > <!-- CL 113475 -->
Extended key usage restrictions are again checked only if they appear in the < code > KeyUsages< / code >
2018-07-16 16:14:58 -06:00
field of < a href = "/pkg/crypto/x509/#VerifyOptions" > < code > VerifyOptions< / code > < / a > , instead of always being checked.
This matches the behavior of Go 1.9 and earlier.
2018-07-16 14:25:06 -06:00
< / p >
< p > <!-- CL 102699 -->
The value returned by < a href = "/pkg/crypto/x509/#SystemCertPool" > < code > SystemCertPool< / code > < / a >
is now cached and might not reflect system changes between invocations.
< / p >
< / dl > <!-- crypto/x509 -->
2018-06-11 11:36:05 -06:00
< dl id = "debug/elf" > < dt > < a href = "/pkg/debug/elf/" > debug/elf< / a > < / dt >
< dd >
< p > <!-- CL 112115 -->
2018-07-18 14:30:25 -06:00
More < a href = "/pkg/debug/elf/#ELFOSABI_NONE" > < code > ELFOSABI< / code > < / a >
and < a href = "/pkg/debug/elf/#EM_NONE" > < code > EM< / code > < / a >
constants have been added.
2018-06-11 11:36:05 -06:00
< / p >
< / dl > <!-- debug/elf -->
< dl id = "encoding/asn1" > < dt > < a href = "/pkg/encoding/asn1/" > encoding/asn1< / a > < / dt >
< dd >
< p > <!-- CL 110561 -->
2018-07-18 14:49:23 -06:00
< code > Marshal< / code > and < code > < a href = "/pkg/encoding/asn1/#Unmarshal" > Unmarshal< / a > < / code >
now support "private" class annotations for fields.
2018-06-11 11:36:05 -06:00
< / p >
< / dl > <!-- encoding/asn1 -->
< dl id = "encoding/base32" > < dt > < a href = "/pkg/encoding/base32/" > encoding/base32< / a > < / dt >
< dd >
< p > <!-- CL 112516 -->
2018-07-18 14:19:04 -06:00
The decoder now consistently
returns < code > io.ErrUnexpectedEOF< / code > for an incomplete
chunk. Previously it would return < code > io.EOF< / code > in some
cases.
2018-06-11 11:36:05 -06:00
< / p >
< / dl > <!-- encoding/base32 -->
< dl id = "encoding/csv" > < dt > < a href = "/pkg/encoding/csv/" > encoding/csv< / a > < / dt >
< dd >
< p > <!-- CL 99696 -->
2018-07-18 14:19:04 -06:00
The < code > Reader< / code > now rejects attempts to set
2018-07-18 14:30:25 -06:00
the < a href = "/pkg/encoding/csv/#Reader.Comma" > < code > Comma< / code > < / a >
field to a double-quote character, as double-quote characters
already have a special meaning in CSV.
2018-06-11 11:36:05 -06:00
< / p >
< / dl > <!-- encoding/csv -->
2018-07-16 08:22:18 -06:00
< dl id = "go/scanner" > < dt > < a href = "/pkg/go/scanner/" > go/scanner< / a > < / dt >
< dd >
< p > <!-- CL 100235 -->
2018-07-18 14:19:04 -06:00
The package no longer modifies filenames in < code > //line< / code >
directives when recording position information or reporting
errors. Previously the package would change relative paths
in < code > //line< / code > directives to absolute paths by
prepending the source file directory.
2018-07-16 08:22:18 -06:00
< / p >
< / dl > <!-- go/scanner -->
< dl id = "html/template" > < dt > < a href = "/pkg/html/template/" > html/template< / a > < / dt >
< dd >
< p > <!-- CL 121815 -->
2018-07-18 14:19:04 -06:00
The package has changed its behavior when a typed interface
value is passed to an implicit escaper function. Previously such
a value was written out as (an escaped form)
of < code > < nil> < / code > . Now such values are ignored, just
as an untyped < code > nil< / code > value is (and always has been)
ignored.
2018-07-16 08:22:18 -06:00
< / p >
< / dl > <!-- html/template -->
2018-06-11 11:36:05 -06:00
< dl id = "image/gif" > < dt > < a href = "/pkg/image/gif/" > image/gif< / a > < / dt >
< dd >
< p > <!-- CL 93076 -->
2018-07-18 14:44:07 -06:00
Non-looping animated GIFs are now supported. They are denoted by having a
< code > < a href = "/pkg/image/gif/#GIF.LoopCount" > LoopCount< / a > < / code > of -1.
2018-06-11 11:36:05 -06:00
< / p >
< / dl > <!-- image/gif -->
< dl id = "io/ioutil" > < dt > < a href = "/pkg/io/ioutil/" > io/ioutil< / a > < / dt >
< dd >
< p > <!-- CL 105675 -->
2018-07-18 15:57:36 -06:00
The < code > < a href = "/pkg/io/ioutil/#TempFile" > TempFile< / a > < / code >
function now supports specifying where the random characters in
the filename are placed. If the < code > prefix< / code > argument
includes a "< code > *< / code > ", the random string replaces the
"< code > *< / code > ". For example, a < code > prefix< / code > argument of "< code > myname.*.bat< / code > " will
result in a random filename such as
"< code > myname.123456.bat< / code > ". If no "< code > *< / code > " is
included the old behavior is retained, and the random digits are
appended to the end.
2018-06-11 11:36:05 -06:00
< / p >
< / dl > <!-- io/ioutil -->
< dl id = "math/big" > < dt > < a href = "/pkg/math/big/" > math/big< / a > < / dt >
< dd >
2018-07-16 14:25:06 -06:00
< p > <!-- CL 108996 -->
< a href = "/pkg/math/bin/#Int.ModInverse" > < code > ModInverse< / code > < / a > now returns nil when g and n are not relatively prime. The result was previously undefined.
< / p >
2018-06-11 11:36:05 -06:00
< / dl > <!-- math/big -->
2018-07-16 08:22:18 -06:00
< dl id = "mime/multipart" > < dt > < a href = "/pkg/mime/multipart/" > mime/multipart< / a > < / dt >
< dd >
< p > <!-- CL 121055 -->
TODO: < a href = "https://golang.org/cl/121055" > https://golang.org/cl/121055< / a > : restore 1.9 handling of missing/empty form-data file name
< / p >
< / dl > <!-- mime/multipart -->
< dl id = "mime/quotedprintable" > < dt > < a href = "/pkg/mime/quotedprintable/" > mime/quotedprintable< / a > < / dt >
< dd >
< p > <!-- CL 121095 -->
2018-07-16 11:05:59 -06:00
To support invalid input found in the wild, the package now
permits non-ASCII bytes but does not validate their encoding.
2018-07-16 08:22:18 -06:00
< / p >
< / dl > <!-- mime/quotedprintable -->
2018-06-11 11:36:05 -06:00
< dl id = "net" > < dt > < a href = "/pkg/net/" > net< / a > < / dt >
< dd >
< p > <!-- CL 72810 -->
2018-07-16 11:05:59 -06:00
The new < a href = "/pkg/net/#ListenConfig" > < code > ListenConfig< / code > < / a > type and the new
< a href = "/pkg/net/#Dialer.Control" > < code > Dialer.Control< / code > < / a > field permit
setting socket options before accepting and creating connections, respectively.
2018-06-11 11:36:05 -06:00
< / p >
< p > <!-- CL 76391 -->
TODO: < a href = "https://golang.org/cl/76391" > https://golang.org/cl/76391< / a > : implement (*syscall.RawConn).Read/Write on Windows
< / p >
< p > <!-- CL 107715 -->
2018-07-16 11:05:59 -06:00
The < code > net< / code > package now automatically uses the
< a href = "http://man7.org/linux/man-pages/man2/splice.2.html" > < code > splice< / code > system call< / a >
on Linux when calling copying data between TCP connections in
< a href = "/pkg/net/#TCPConn.ReadFrom" > < code > TCPConn.ReadFrom< / code > < / a > , as called by
< a href = "/pkg/io/#Copy" > < code > io.Copy< / code > . The result is faster, more efficient TCP proxying.
2018-06-11 11:36:05 -06:00
< / p >
< p > <!-- CL 108297 -->
TODO: < a href = "https://golang.org/cl/108297" > https://golang.org/cl/108297< / a > : calling File leaves the socket in nonblocking mode
< / p >
< / dl > <!-- net -->
< dl id = "net/http" > < dt > < a href = "/pkg/net/http/" > net/http< / a > < / dt >
< dd >
2018-07-16 08:22:18 -06:00
< p > <!-- CL 71272 -->
2018-07-16 10:35:04 -06:00
The < a href = "/pkg/net/http/#Transport" > < code > Transport< / code > < / a > has a
new < a href = "/pkg/net/http/#Transport.MaxConnsPerHost" > < code > MaxConnsPerHost< / code > < / a >
option that permits limiting the maximum number of connections
per host.
2018-07-16 08:22:18 -06:00
< / p >
< p > <!-- CL 79919 -->
2018-07-16 10:35:04 -06:00
The < a href = "/pkg/net/http/#Cookie" > < code > Cookie< / code > < / a > type has a new
The < a href = "/pkg/net/http/#Cookie.SameSite" > < code > SameSite< / code > < / a > field
(of new type also named
< a href = "/pkg/net/http/#SameSite" > < code > SameSite< / code > < / a > ) to represent the new cookie attribute recently supported by most browsers.
The < code > net/http< / code > 's < code > Transport< / code > does not use the < code > SameSite< / code >
attribute itself, but the package supports parsing and serializing the
attribute for browsers to use.
2018-07-16 08:22:18 -06:00
< / p >
< p > <!-- CL 81778 -->
2018-07-16 10:35:04 -06:00
It is no longer allowed to reuse a < a href = "/pkg/net/http/#Server" > < code > Server< / code > < / a >
after a call to
< a href = "/pkg/net/http/#Server.Shutdown" > < code > Shutdown< / code > < / a > or
< a href = "/pkg/net/http/#Server.Close" > < code > Close< / code > < / a > . It was never officially supported
in the past and had often surprising behavior. Now, all future calls to the server's < code > Serve< / code >
methods will return errors after a shutdown or close.
2018-07-16 08:22:18 -06:00
< / p >
2018-06-11 11:36:05 -06:00
< p > <!-- CL 89275 -->
2018-07-16 10:35:04 -06:00
The HTTP server will no longer automatically set the Content-Type if a
< code > Handler< / code > sets the "< code > X-Content-Type-Options< / code > " header to "< code > nosniff< / code > ".
2018-06-11 11:36:05 -06:00
< / p >
< p > <!-- CL 93296 -->
2018-07-16 10:35:04 -06:00
The constant < code > StatusMisdirectedRequest< / code > is now defined for HTTP status code 421.
2018-06-11 11:36:05 -06:00
< / p >
2018-07-16 08:22:18 -06:00
< p > <!-- CL 123875 -->
2018-07-16 10:35:04 -06:00
The HTTP server will no longer cancel contexts or send on
< a href = "/pkg/net/http/#CloseNotifier" > < code > CloseNotifier< / code > < / a >
channels upon receiving pipelined HTTP/1.1 requests. Browsers do
not use HTTP pipelining, but some clients (such as
Debian's < code > apt< / code > ) may be configured to do so.
2018-07-16 08:22:18 -06:00
< / p >
2018-07-16 12:22:26 -06:00
< p > <!-- CL 115255 -->
< a href = "/pkg/net/http/#ProxyFromEnvironment" > < code > ProxyFromEnvironment< / code > < / a > , which is used by the
< a href = "/pkg/net/http/#DefaultTransport" > < code > DefaultTransport< / code > < / a > , now
supports CIDR notation and ports in the < code > NO_PROXY< / code > environment variable.
< / p >
2018-06-11 11:36:05 -06:00
< / dl > <!-- net/http -->
2018-07-16 12:22:26 -06:00
< dl id = "net/http/httputil" > < dt > < a href = "/pkg/net/http/httputil/" > net/http/httputil< / a > < / dt >
< dd >
< p > <!-- CL 77410 -->
The
< a href = "/pkg/net/http/httputil/#ReverseProxy" > < code > ReverseProxy< / code > < / a >
has a new
< a href = "/pkg/net/http/httputil/#ReverseProxy.ErrorHandler" > < code > ErrorHandler< / code > < / a >
option to permit changing how errors are handled.
< / p >
< / dl > <!-- net/http/httputil -->
2018-06-11 11:36:05 -06:00
< dl id = "os" > < dt > < a href = "/pkg/os/" > os< / a > < / dt >
< dd >
< p > <!-- CL 78835 -->
2018-07-16 12:22:26 -06:00
The new < a href = "/pkg/os/#UserCacheDir" > < code > UserCacheDir< / code > < / a > function
returns the default root directory to use for user-specific cached data.
2018-06-11 11:36:05 -06:00
< / p >
< p > <!-- CL 94856 -->
2018-07-16 12:22:26 -06:00
The new < a href = "/pkg/os/#ModeIrregular" > < code > ModeIrregular< / code > < / a >
is a < a href = "/pkg/os/#FileMode" > < code > FileMode< / code > < / a > bit to represent
that a file is not a regular file, but nothing else is known about it, or that
it's not a socket, device, named pipe, symlink, or other file type for which
Go has a defined mode bit.
2018-06-11 11:36:05 -06:00
< / p >
< p > <!-- CL 99337 -->
2018-07-18 15:57:36 -06:00
< a href = "/pkg/os/#Symlink" > < code > Symlink< / code > < / a > now works
for unprivileged users on Windows 10 on machines with Developer
Mode enabled.
2018-06-11 11:36:05 -06:00
< / p >
< p > <!-- CL 100077 -->
TODO: < a href = "https://golang.org/cl/100077" > https://golang.org/cl/100077< / a > : use poller when NewFile is called with a blocking descriptor.
< / p >
< / dl > <!-- os -->
< dl id = "os/signal" > < dt > < a href = "/pkg/os/signal/" > os/signal< / a > < / dt >
< dd >
< p > <!-- CL 108376 -->
2018-07-16 12:37:13 -06:00
The new < a href = "/pkg/os/signal/#Ignored" > < code > Ignored< / code > < / a > function reports
whether a signal is currently ignored.
2018-06-11 11:36:05 -06:00
< / p >
< / dl > <!-- os/signal -->
< dl id = "os/user" > < dt > < a href = "/pkg/os/user/" > os/user< / a > < / dt >
< dd >
< p > <!-- CL 92456 -->
2018-07-16 11:05:59 -06:00
The < code > os/user< / code > package can now be built in pure Go
mode using the build tag "< code > osusergo< / code > ",
independent of the use of the environment
variable < code > CGO_ENABLED=0< / code > . Previously the only way to use
the package's pure Go implementation was to disable < code > cgo< / code >
support across the entire program.
2018-06-11 11:36:05 -06:00
< / p >
< / dl > <!-- os/user -->
2018-07-16 11:05:59 -06:00
<!-- CL 101715 was reverted -->
2018-07-16 08:22:18 -06:00
< dl id = "runtime" > < dt > < a href = "/pkg/runtime/" > runtime< / a > < / dt >
< dd >
2018-07-16 12:22:26 -06:00
< p > <!-- CL 70993 -->
2018-07-17 15:49:37 -06:00
Setting the < code > GODEBUG=tracebackancestors=< em > N< / em > < / code >
environment variable now extends tracebacks with the stacks at
which goroutines were created, where < em > N< / em > limits the
number of ancestor goroutines to report.
2018-07-16 12:22:26 -06:00
< / p >
2018-07-16 08:22:18 -06:00
< / dl > <!-- runtime -->
< dl id = "runtime/pprof" > < dt > < a href = "/pkg/runtime/pprof/" > runtime/pprof< / a > < / dt >
< dd >
< p > <!-- CL 102696 -->
2018-07-17 15:49:37 -06:00
This release adds a new "allocs" profile type that profiles
total number of bytes allocated since the program began
(including garbage-collected bytes). This is identical to the
2018-07-18 01:06:21 -06:00
existing "heap" profile viewed in < code > -alloc_space< / code > mode.
Now < code > go test -memprofile=...< / code > reports an "allocs" profile
instead of "heap" profile.
2018-07-16 08:22:18 -06:00
< / p >
< / dl > <!-- runtime/pprof -->
2018-06-11 11:36:05 -06:00
< dl id = "sync" > < dt > < a href = "/pkg/sync/" > sync< / a > < / dt >
< dd >
< p > <!-- CL 87095 -->
2018-07-17 15:49:37 -06:00
The mutex profile now includes reader/writer contention
2018-07-18 10:20:49 -06:00
for < a href = "/pkg/sync/#RWMutex" > < code > RWMutex< / code > < / a > .
2018-07-17 15:49:37 -06:00
Writer/writer contention was already included in the mutex
profile.
2018-06-11 11:36:05 -06:00
< / p >
< / dl > <!-- sync -->
< dl id = "syscall" > < dt > < a href = "/pkg/syscall/" > syscall< / a > < / dt >
< dd >
< p > <!-- CL 106275 -->
2018-07-16 12:22:26 -06:00
On Windows, several fields were changed from < code > uintptr< / code > to a new
< a href = "/pkg/syscall/?GOOS=windows&GOARCH=amd64#Pointer" > < code > Pointer< / code > < / a >
type to avoid problems with Go's garbage collector. The same change was made
to the < a href = "https://godoc.org/golang.org/x/sys/windows" > < code > golang.org/x/sys/windows< / code > < / a >
package. For any code affected, users should first migrate away from the < code > syscall< / code >
package to the < code > golang.org/x/sys/windows< / code > package, and then change
to using the < code > Pointer< / code > , while obeying the
< a href = "/pkg/unsafe/#Pointer" > < code > unsafe.Pointer< / code > conversion rules< / a > .
2018-06-11 11:36:05 -06:00
< / p >
2018-07-16 08:22:18 -06:00
< p > <!-- CL 118658 -->
2018-07-18 10:20:49 -06:00
On Linux, the < code > flags< / code > parameter to
< a href = "/pkg/syscall/?GOOS=linux&GOARCH=amd64#Fchmodat" > < code > Fchmodat< / code > < / a >
is now validated. Linux's < code > fchmodat< / code > doesn't support the < code > flags< / code > parameter
so we now mimic glibc's behavior and return an error if it's non-zero.
2018-07-16 08:22:18 -06:00
< / p >
2018-06-11 11:36:05 -06:00
< / dl > <!-- syscall -->
< dl id = "text/scanner" > < dt > < a href = "/pkg/text/scanner/" > text/scanner< / a > < / dt >
< dd >
< p > <!-- CL 112037 -->
2018-07-18 14:20:56 -06:00
The < a href = "/pkg/text/scanner/#Scanner.Scan" > < code > Scanner.Scan< / code > < / a > method now returns
the < a href = "/pkg/text/scanner/#RawString" > < code > RawString< / code > < / a > token
instead of < a href = "/pkg/text/scanner/#String" > < code > String< / code > < / a >
2018-07-18 13:04:02 -06:00
for raw string literals.
2018-06-11 11:36:05 -06:00
< / p >
< / dl > <!-- text/scanner -->
< dl id = "text/template" > < dt > < a href = "/pkg/text/template/" > text/template< / a > < / dt >
< dd >
< p > <!-- CL 84480 -->
2018-07-18 13:04:02 -06:00
Modifying template variables via assignments is now permitted via the < code > =< / code > token:
< / p >
< pre >
{{"{{"}} $v := "init" {{"}}"}}
{{"{{"}} if true {{"}}"}}
{{"{{"}} $v = "changed" {{"}}"}}
{{"{{"}} end {{"}}"}}
v: {{"{{"}} $v {{"}}"}} {{"{{"}}/* "changed" */{{"}}"}}< / pre >
< p >
This required backwards-incompatible changes to the < code > text/template/parse< / code >
package, but was deemed acceptable since the package's documentation clearly states
that it isn't intended for general use.
2018-06-11 11:36:05 -06:00
< / p >
2018-07-16 08:22:18 -06:00
< p > <!-- CL 95215 -->
2018-07-18 14:19:04 -06:00
In previous versions untyped < code > nil< / code > values passed to
template functions were ignored. They are now passed as normal
arguments.
2018-07-16 08:22:18 -06:00
< / p >
2018-06-11 11:36:05 -06:00
< / dl > <!-- text/template -->
< dl id = "time" > < dt > < a href = "/pkg/time/" > time< / a > < / dt >
< dd >
< p > <!-- CL 98157 -->
2018-07-18 04:00:16 -06:00
Parsing of timezones denoted by sign and offset is now
supported. In previous versions, numeric timezone names
(such as < code > +03< / code > ) were not considered valid, and only
three-letter abbreviations (such as < code > MST< / code > ) were accepted
when expecting a timezone name.
2018-06-11 11:36:05 -06:00
< / p >
< / dl > <!-- time -->