3 min read

Go 1.12 was released yesterday with opt-in support for TLS 1.3, improved modules support, support for windows/arm, and improved macOS & iOS forwards compatibility. The previous Go version, Go 1.11 was released in August last year.

What’s new in Go 1.12?

Opt-in support for TLS 1.3

Go 1.12 adds opt-in support for TLS 1.3 in the crypto/tls package. It can be enabled by adding the value tls13 = 1 to the GODEBUG environment variable. It will be enabled by default in Go 1.13.

  • All TLS 1.2 features except TLSUnique in ConnectionState and renegotiation are available in TLS 1.3 and provide equivalent or better security and performance.
  • TLS 1.3 cipher suites are not configurable.
  • Since TLS 1.3 0-RTT mode involves clients keeping state regarding which servers support 0-RTT, a Go 1.12 server cannot be part of a load-balancing pool where some other servers do support 0-RTT.
  • In TLS 1.3, the client is the last one to speak in the handshake, so if it causes an error to occur on the server, it will be returned on the client by the first Read, not by Handshake.

Improved Module support

The go command now supports module-aware operations outside of a module directory, provided that those operations do not need to resolve import paths relative to the current directory or explicitly edit the go.mod file.

  • Commands such as go get, go list, and go mod download behave as if in a module with initially-empty requirements.
  • go commands that download and extract modules are now safe to invoke concurrently.
  • The go directive in a go.mod file now indicates the version of the language used by the files within that module.
  • The go command will now try to use the modules mentioned in the main module’s replace directives before consulting the module cache and the usual network sources. This happens when an import cannot be resolved using the active modules.

Other changes

  • Go’s new windows/arm port supports running Go on Windows 10 IoT Core on 32-bit ARM chips. It also supports AIX 7.2 and later on POWER8 architectures (aix/ppc64). For macOS, Go 1.13 will require macOS 10.11 El Capitan or later.
  • The go vet command has been rewritten so go tool vet is no longer supported.
  • The Go tour is no longer included in the main binary distribution.
  • The build cache is now required as a step toward eliminating $GOPATH/pkg
  • Go 1.12 will translate the C type EGLDisplay to the Go type uintptr.
  • The compiler’s live variable analysis has improved. Wrappers generated by the compiler to implement method expressions are no longer reported by runtime.CallersFrames and runtime.Stack. The compiler toolchain now uses different conventions to call Go functions and assembly functions.
  • Go 1.12 is the last release that will include the godoc webserver; in Go 1.13 it will be available via go get.
  • The trace tool now supports plotting mutator utilization curves, including cross-references to the execution trace.
  • Go 1.12 significantly improves the performance of sweeping when a large fraction of the heap remains live.

These are just a select few updates. For full details about the changes in Go 1.12, you may go through the Go 1.12 release notes.

Read Next

Go 1.11 support announced for Google Cloud Functions!

Go 1.11.3 and Go 1.10.6 released with fixes to security issues

Google Cloud announces new Go 1.11 runtime for App Engine

Content Marketing Editor at Packt Hub. I blog about new and upcoming tech trends ranging from Data science, Web development, Programming, Cloud & Networking, IoT, Security and Game development.