1.4.3

Latest release in branch 1.4
Released 10 years ago (September 23, 2015)

Software Go
Branch 1.4
Status
End of life
End of life February 17, 2016
First official release version 1.4
First official release date 11 years ago (December 11, 2014)
Release notes https://go.dev/doc/go1.4
Source code https://github.com/golang/go/tree/go1.4.3
Documentation https://go.dev/doc/
Go 1.4 Releases View full list

What Is New in Go 1.4

Go 1.4 is a significant release focused on foundational improvements to the toolchain, runtime, and language, paving the way for future advancements.

Category Key Changes
Toolchain Native support for ARM and Android; internal code reorganization; new go generate command.
Runtime & Performance Precise garbage collector; stack reimplementation; defer performance improvements.
Language New for-range loop variable semantics; minor spec clarifications.
Libraries New crypto/tls features; time package updates; go/parser skips BOM.
Experimental Early support for GOARCH=arm64 (aka AArch64).

How did the toolchain evolve in Go 1.4?

The compiler toolchain saw major internal changes and new platform support. The most notable shift was the rewriting of the compiler and assembler from C to Go, a massive internal change that simplified the codebase for future development.

Native support for ARM and Android was a huge win for mobile and embedded development. The new go generate command provided a standard way to run code generation tools before builds, which became essential for many modern Go projects.

In practice, the toolchain became more self-hosting and easier to maintain. This internal cleanup was a necessary step for the more ambitious compiler changes that arrived in later versions.

What runtime and performance improvements were made?

Go 1.4 introduced a precise garbage collector, a foundational upgrade. This new collector knew the exact location of pointers in memory, which eliminated memory limitations and improved reliability for long-running programs.

Stacks were completely reimplemented using a contiguous model instead of the old segmented "hot split" approach. This change made stack management more efficient and reduced overhead. The defer statement also became much cheaper to use, addressing a common performance concern.

These changes made the runtime more robust and predictable. The new GC, while not yet a low-latency collector, was a critical step towards the concurrent collector that came later.

Were there any language changes in Go 1.4?

The language spec saw a subtle but important clarification for for-range loops. The iteration variables were redefined to be per-iteration rather than per-loop, which made capturing their addresses in goroutines safer and more intuitive.

This change prevented a common class of bugs where goroutines inside a loop would all capture the same variable address. The update made the language semantics more consistent and predictable for concurrent code.

Otherwise, the language remained stable. The focus was on refining the existing specification rather than adding new syntax or features.

What new library features were added?

The crypto/tls package gained new features for dynamic certificate management. Servers could now dynamically select certificates based on the client's SNI (Server Name Indication), enabling better support for hosting multiple HTTPS sites.

The time package added the Duration.Truncate and Duration.Round methods, providing cleaner ways to handle time durations. The go/parser package was updated to automatically skip a Unicode byte order mark (BOM) at the beginning of a source file.

These library updates addressed practical needs for web servers and tooling. The BOM handling, for instance, fixed a common annoyance when working with files generated on Windows systems.

FAQ

Does the new garbage collector in Go 1.4 reduce pause times?
No, the new precise garbage collector was not designed for low latency. Its main goal was to eliminate memory size limitations and improve correctness by knowing the exact location of all pointers, which was a necessary foundation for the concurrent collector that came in Go 1.5.

What does the new 'go generate' command do?
It provides a standard way to run code generation tools before compilation. You define directives in your source files like //go:generate stringer -type=Pill, and running go generate executes these commands. It's useful for automating the creation of repetitive code.

Why did the for-range loop semantics change?
The change made iteration variables per-iteration instead of per-loop. This fixed a common bug where goroutines launched inside a loop would all capture the same variable address, leading to unexpected behavior. The new semantics are more intuitive for concurrent programming.

Is Go 1.4 suitable for Android development?
Yes, this release added official support for compiling Go programs to run on Android devices. It included the ability to build native Android APKs using the Go toolchain, which was a significant step for mobile development with Go.

What was the biggest internal change in Go 1.4?
The massive internal rewrite of the compiler toolchain from C to Go. This change made the Go compiler self-hosting (written in Go itself) and greatly simplified the codebase, making it easier to maintain and evolve for future versions.

Releases In Branch 1.4

Version Release date
1.4.3 10 years ago
(September 23, 2015)
1.4.2 11 years ago
(February 18, 2015)
1.4.1 11 years ago
(January 15, 2015)
1.4 11 years ago
(December 11, 2014)
1.4rc2 11 years ago
(December 02, 2014)
1.4rc1 11 years ago
(November 17, 2014)
1.4beta1 11 years ago
(October 30, 2014)