DRAFT RELEASE NOTES — Introduction to Go 1.14

Go 1.14 is not yet released. These are work-in-progress release notes. Go 1.14 is expected to be released in February 2020.

Changes to the language

TODO

TODO: https://golang.org/cl/187519: allow embedding overlapping interfaces

Ports

TODO: is Dragonfly passing? On both Dragonfly release & tip? (ABI change happened) Does the net package's interface APIs work on both? https://golang.org/issue/34368.

TODO: is Illumos up with a builder and passing? https://golang.org/issue/15581.

TODO: announce something about the Go Solaris port? Solaris itself is unmaintained? The builder is still running at Oracle, but the employee who set it up left the company and we have no way to maintain it.

Darwin

Go 1.14 is the last Go release to support 32-bit binaries on macOS (the darwin/386 port). They are no longer supported by macOS, starting with macOS 10.15 (Catalina). Go continues to support the 64-bit darwin/amd64 port.

Go 1.14 will likely be the last Go release to support 32-bit binaries on iOS, iPadOS, watchOS, and tvOS (the darwin/arm port). Go continues to support the 64-bit darwin/arm64 port.

Windows

Go binaries on Windows now have DEP (Data Execution Prevention) enabled.

WebAssembly

JavaScript values referenced from Go via js.Value objects can now be garbage collected.

js.Value values can no longer be compared using the == operator, and instead must be compared using their Equal method.

js.Value now has IsUndefined, IsNull, and IsNaN methods.

FreeBSD

Go now supports the 64-bit ARM architecture on FreeBSD (the freebsd/arm64 port).

Native Client (NaCl)

As announced in the Go 1.13 release notes, Go 1.14 drops support for the Native Client platform (GOOS=nacl).

The runtime now respects zone CPU caps (the zone.cpu-cap resource control) for runtime.NumCPU and the default value of GOMAXPROCS.

Tools

TODO

Go command

Vendoring

When the main module contains a top-level vendor directory and its go.mod file specifies go 1.14 or higher, the go command now defaults to -mod=vendor for operations that accept that flag. A new value for that flag, -mod=mod, causes the go command to instead load modules from the module cache (as when no vendor directory is present).

When -mod=vendor is set (explicitly or by default), the go command now verifies that the main module's vendor/modules.txt file is consistent with its go.mod file.

go list -m no longer silently omits transitive dependencies that do not provide packages in the vendor directory. It now fails explicitly if -mod=vendor is set.

Flags

The go get command no longer accepts the -mod flag. Previously, the flag's setting either was ignored or caused the build to fail.

-mod=readonly is now set by default when the go.mod file is read-only and no top-level vendor directory is present.

-modcacherw is a new flag that instructs the go command to leave newly-created directories in the module cache at their default permissions rather than making them read-only. The use of this flag makes it more likely that tests or other tools will accidentally add files not included in the module's verified checksum. However, it allows the use of rm -rf (instead of go clean -modcache) to remove the module cache.

-modfile=file is a new flag that instructs the go command to read (and possibly write) an alternate go.mod file instead of the one in the module root directory. A file named "go.mod" must still be present in order to determine the module root directory, but it is not accessed. When -modfile is specified, an alternate go.sum file is also used: its path is derived from the -modfile flag by trimming the ".mod" extension and appending ".sum".

+incompatible versions

If the latest version of a module contains a go.mod file, go get will no longer upgrade to an incompatible major version of that module unless such a version is requested explicitly or is already required. go list also omits incompatible major versions for such a module when fetching directly from version control, but may include them if reported by a proxy.

go.mod file maintenance

go commands other than go mod tidy no longer remove a require directive that specifies a version of an indirect dependency that is already implied by other (transitive) dependencies of the main module.

go commands other than go mod tidy no longer edit the go.mod file if the changes are only cosmetic.

When -mod=readonly is set, go commands will no longer fail due to a missing go directive or erroneous // indirect comment.

Module downloading

The go command now supports Subversion repositories in module mode.

The go command now includes snippets of plain-text error messages from module proxies and other HTTP servers. An error message will only be shown if it is valid UTF-8 and consists of only graphic characters and spaces.

Runtime

This release improves the performance of most uses of defer to incur almost zero overhead compared to calling the deferred function directly. As a result, defer can now be used in performance-critical code without overhead concerns.

Goroutines are now asynchronously preemptible. As a result, loops without function calls no longer potentially deadlock the scheduler or significantly delay garbage collection. This is supported on all platforms except windows/arm, darwin/arm, js/wasm, and plan9/*.

The page allocator is more efficient and incurs significantly less lock contention at high values of GOMAXPROCS. This is most noticeable as lower latency and higher throughput for large allocations being done in parallel and at a high rate.

Internal timers, used by time.After, time.Tick, net.Conn.SetDeadline, and friends, are more efficient, with less lock contention and fewer context switches. This is a performance improvement that should not cause any user visible changes.

Compiler

This release adds -d=checkptr as a compile-time option for adding instrumentation to check that Go code is following unsafe.Pointer safety rules dynamically. This option is enabled by default with the -race or -msan flags, and can be disabled with -gcflags=-all=-d=checkptr=0. Specifically, -d=checkptr checks the following:

  1. When converting unsafe.Pointer to *T, the resulting pointer must be aligned appropriately for T.
  2. If the result of pointer arithmetic points into a Go heap object, one of the unsafe.Pointer-typed operands must point into the same object.

The compiler can now emit machine-readable logs of key optimizations using the -json flag, including inlining, escape analysis, bounds-check elimination, and nil-check elimination

Detailed escape analysis diagnostics (-m=2) now work again. This had been dropped from the new escape analysis implementation in the previous release.

All Go symbols in macOS binaries now begin with an underscore, following platform conventions.

This release includes experimental support for compiler-inserted coverage instrumentation for fuzzing. See the issue for more details. This API may change in future releases.

Core library

TODO

bytes/hash

TODO: https://golang.org/cl/186877: add hashing package for bytes and strings

crypto/tls

TODO: https://golang.org/cl/191976: remove SSLv3 support

TODO: https://golang.org/cl/191999: remove TLS 1.3 opt-out

The tls package no longer supports NPN and now only supports ALPN. In previous releases it supported both. There are no API changes and code should function identically as before. Most other clients & servers have already removed NPN support in favor of the standardized ALPN.

encoding/asn1

TODO: https://golang.org/cl/126624: handle ASN1's string type BMPString

mime

TODO: https://golang.org/cl/186927: update type of .js and .mjs files to text/javascript

math

The new FMA function computes x*y+z in floating point with no intermediate rounding of the x*y computation. Several architectures implement this computation using dedicated hardware instructions for additional performance.

plugin

The plugin package now supports freebsd/amd64.

reflect

StructOf now supports creating struct types with unexported fields, by setting the PkgPath field in a StructField element.

runtime

runtime.Goexit can no longer be aborted by a recursive panic/recover.

On macOS, SIGPIPE is no longer forwarded to signal handlers installed before the Go runtime is initialized. This is necessary because macOS delivers SIGPIPE to the main thread rather than the thread writing to the closed pipe.

signal

On Windows, the CTRL_CLOSE_EVENT, CTRL_LOGOFF_EVENT, and CTRL_SHUTDOWN_EVENT events now generate a syscall.SIGTERM signal, similar to how Control-C and Control-Break generate a syscall.SIGINT signal.

testing

The testing package now supports cleanup functions, called after a test or benchmark has finished, by calling T.Cleanup or B.Cleanup respectively.

Minor changes to the library

As always, there are various minor changes and updates to the library, made with the Go 1 promise of compatibility in mind.

TODO