DRAFT RELEASE NOTES - Introduction to Go 1.9

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.

The latest Go release, version 1.9, arrives six months after Go 1.8 and is the tenth release in the Go 1.x series. There is one change to the language, 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 promise of compatibility. We expect almost all Go programs to continue to compile and run as before.

The release adds transparent monotonic time support, parallelizes compilation of functions within a package, better supports test helper functions, and includes a new bit manipulation package.

Changes to the language

There is one change to the language. Go now supports type aliases to support gradual code repair while moving a type between packages. The type alias design document and an article on refactoring cover the problem in detail. In short, a type alias declaration has the form:

type T1 = T2

This declaration introduces an alias name T1—an alternate spelling—for the type denoted by T2; that is, both T1 and T2 denote the same type.

Ports

There are no new supported operating systems or processor architectures in this release.

ppc64x requires Power8

Both GOARCH=ppc64 and GOARCH=ppc64le now require at least Power8 support. In previous releases, only GOARCH=ppc64le required Power8 and the big endian ppc64 architecture supported older hardware.

Known Issues

There are some instabilities on FreeBSD that are known but not understood. These can lead to program crashes in rare cases. See issue 15658. Any help in solving this FreeBSD-specific issue would be appreciated.

Tools

Parallel Compilation

The Go compiler now supports compiling a package's functions in parallel, taking advantage of multiple cores. This is in addition to the go 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 GO19CONCURRENTCOMPILATION to 0.

Performance

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.

TODO: There have been significant optimizations bringing more than 10% improvements to implementations in the foo, bar, and quux packages.

Garbage Collector

TODO(austin): give update.

Core library

Transparent Monotonic Time support

The time package now transparently tracks monotonic time in each Time value, making computing durations between two Time values a safe operation in the presence of wall clock adjustments. See the package docs and design document for details.

New bit manipulation package

Go 1.9 includes a new package, math/bits, 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.

Test Helper Functions

The new (*T).Helper an (*B).Helper methods mark the calling function as a test helper function. When printing file and line information, that function will be skipped. This permits writing test helper functions while still having useful line numbers for users.

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.

archive/zip

TODO: https://golang.org/cl/39570: set utf-8 flag

crypto

TODO: https://golang.org/cl/36876: add BLAKE2b and BLAKE2s hash constants

crypto/aes

TODO: https://golang.org/cl/38366: ARM assembly versions of encrypt, decrypt and expandKey

crypto/rand

TODO: https://golang.org/cl/43852: use blocking getrandom call on Linux when supported

crypto/x509

TODO: https://golang.org/cl/36093: load certs from env vars + extra locations

TODO: https://golang.org/cl/36900: support excluded domains in name constraints.

database/sql

TODO: https://golang.org/cl/35476: proper prepared statement support in transactions

TODO: https://golang.org/cl/39031: support scanning into user defined string types

TODO: https://golang.org/cl/40694: allow using a single connection from the database

debug/dwarf

TODO: https://golang.org/cl/44017: heuristically handle both UNIX and Windows paths

encoding/asn1

TODO: https://golang.org/cl/38660: add NullBytes and NullRawValue for working with ASN.1 NULL

encoding/base32

TODO: https://golang.org/cl/38634: add Encoding.WithPadding, StdPadding, NoPadding

encoding/gob

TODO: https://golang.org/cl/39203: speedup decoding of maps by zeroing values

fmt

TODO: https://golang.org/cl/37051: support sharp flag for float and complex value printing

go/build

TODO: https://golang.org/cl/44291: make -I/-L options in cgo flags absolute

hash/fnv

TODO: https://golang.org/cl/38356: add 128-bit FNV hash support

html/template

TODO: https://golang.org/cl/37880: panic if predefined escapers are found in pipelines during rewriting

TODO: https://golang.org/cl/40936: allow safe usage of predefined escapers in pipelines

image

TODO: https://golang.org/cl/36734: fix the overlap check in Rectangle.Intersect.

image/color

TODO: https://golang.org/cl/36732: tweak the YCbCr to RGBA conversion formula again.

image/png

TODO: https://golang.org/cl/34150: reduce memory allocs encoding images by reusing buffers

TODO: https://golang.org/cl/38271: decode Gray8 transparent images.

math/big

TODO: https://golang.org/cl/36487: add IsInt64/IsUint64 predicates

math/bits

TODO: https://golang.org/cl/36315: added package for bit-level counting and manipulation

mime/multipart

TODO: https://golang.org/cl/39223: add Size to FileHeader

net

TODO: https://golang.org/cl/32572: add Resolver.StrictErrors

TODO: https://golang.org/cl/37260: allow Resolver to use a custom dialer

TODO: https://golang.org/cl/37402: implement deadline functionality on Pipe

TODO: https://golang.org/cl/40510: don't enclose non-literal IPv6 addresses in square brackets

TODO: https://golang.org/cl/40512: validate network in Dial{,IP} and Listen{Packet,IP} for IP networks

net/http

TODO: https://golang.org/cl/35488: add support for socks5 proxy

TODO: https://golang.org/cl/38194: strip port from host in mux Handler

TODO: https://golang.org/cl/43231: for http2, use the priority write scheduler by default

net/http/fcgi

TODO: https://golang.org/cl/40012: expose cgi env vars in request context

net/http/httptest

TODO: https://golang.org/cl/34639: add Client and Certificate to Server

net/rpc

TODO: https://golang.org/cl/38474: Create empty maps and slices as return type

os

TODO: https://golang.org/cl/37915: parse command line without shell32.dll

TODO: https://golang.org/cl/41830: do not report ModeDir for symlinks on windows

os/exec

TODO: https://golang.org/cl/37586: remove duplicate environment variables in Cmd.Start

os/user

TODO: https://golang.org/cl/33713: add Go implementation of LookupGroup, LookupGroupId

TODO: https://golang.org/cl/37664: add non-cgo versions of Lookup, LookupId

reflect

TODO: https://golang.org/cl/38335: Add MakeMapWithSize for creating maps with size hint

runtime

TODO: https://golang.org/cl/29341: use cpuset_getaffinity for runtime.NumCPU() on FreeBSD

TODO: https://golang.org/cl/34937: make ReadMemStats STW for < 25µs

TODO: https://golang.org/cl/35710: make time correctly update on Wine

TODO: https://golang.org/cl/37233: use inlining tables to generate accurate tracebacks

TODO: https://golang.org/cl/37441: make complex division c99 compatible

TODO: https://golang.org/cl/37520: make runtime.GC() trigger a concurrent GC

TODO: https://golang.org/cl/37726: strongly encourage CallersFrames with the result of Callers

TODO: https://golang.org/cl/38403: reduce Windows timer resolution when idle

TODO: https://golang.org/cl/40810: make sweep trace events encompass entire sweep loop

TODO: https://golang.org/cl/43641: use pselect6 for usleep on linux/amd64 and linux/arm

runtime/debug

TODO: https://golang.org/cl/34013: don't run a GC when setting SetGCPercent negative

TODO: https://golang.org/cl/39835: don't trigger a GC on SetGCPercent

runtime/pprof

TODO: https://golang.org/cl/34198: add definitions of profile label types

sync

TODO: https://golang.org/cl/34310: make Mutex more fair

TODO: https://golang.org/cl/36617: import Map from x/sync/syncmap

syscall

TODO: https://golang.org/cl/36697: only call setgroups if we need to

TODO: https://golang.org/cl/37439: use CLONE_VFORK and CLONE_VM

TODO: https://golang.org/cl/37913: add Conn and RawConn interfaces

testing

TODO: https://golang.org/cl/41195: add argument to list tests, benchmarks, and examples

testing/quick

TODO: https://golang.org/cl/39152: generate all possible int64, uint64 values

text/template

TODO: https://golang.org/cl/38420: fix handling of empty blocks

time

TODO: https://golang.org/cl/36615: add Duration.Truncate and Duration.Round