← All releases

go1.10.0

Major

February 16, 2018

Go 1.10 focuses on toolchain and library improvements: build/test caching speed up workflows, tests now auto-run vet, and cgo gains string passing and a security-hardening flag whitelist that may break some builds. No language changes; stdlib tweaks are minor but a few (bytes, net/url) can alter existing program behavior.

highlights
  • go build now determines staleness purely from source/content and build flags (not mtimes), with a new content-addressed build cache; -a and -i are no longer needed for correctness/speed

  • go test now caches successful test results and prints "(cached)" for unchanged test/package/env combos; bypass with -count=1

  • go test automatically runs a high-confidence subset of go vet before testing and fails the test on problems found; disable with -vet=off

  • go install now installs only the packages/commands named on the command line, not their dependencies (use go install -i to also install deps)

  • -asmflags, -gcflags, -gccgoflags, -ldflags now apply only to packages named directly on the command line by default; new pattern=flags syntax targets specific packages

  • cgo now validates #cgo CFLAGS/LDFLAGS/etc. against a whitelist of permitted flags, closing a code-execution security hole but potentially causing new "invalid flag" build errors in existing packages

  • cgo adds direct Go-string interop via _GoString_, _GoStringLen, and _GoStringPtr, plus type-alias handling for C typedefs and niladic macro support

  • go test adds -failfast, -json (with new go tool test2json), and improved -coverpkg/-coverprofile behavior for multi-package/multi-test runs

  • bytes.Fields, FieldsFunc, Split, and SplitAfter now return subslices with capacity capped to length, preventing appends from corrupting adjacent input data

  • net/url.ResolveReference now correctly preserves doubled leading slashes per RFC 3986, changing resolved URLs for inputs with such paths and possibly affecting redirect handling

  • Garbage collector changes reduce allocation latency by using less CPU per GC cycle while running more often, with no significant change in total GC CPU usage; GOMAXPROCS no longer capped at 1024

  • This is the last release supporting FreeBSD 9.3 removal aside, OpenBSD 6.0, OS X 10.8/10.9, and Windows XP/Vista; Go 1.11 will require newer minimum OS versions on these platforms