Polyglot
Languages Go
Volume Go

Go

A general-purpose, statically typed, compiled language designed at Google. Combines a small grammar, garbage collection, and built-in concurrency primitives with a single canonical toolchain.

Paradigms
imperative · concurrent
Typing
static
Memory
gc
Version
1.24
First released
2009

Go is a general-purpose, statically typed, compiled programming language designed at Google. The language couples a deliberately small grammar with a substantial standard library, garbage collection, and first-class concurrency primitives — goroutines and channels — built into the language proper. Programs are compiled directly to native machine code; there is no virtual machine and no separate runtime distribution beyond the small Go runtime statically linked into each binary. The toolchain is canonical: a single go command performs build, test, dependency management, formatting, and documentation generation, and the language specification commits to backward compatibility within the 1.x series, with each minor release expected to compile programs written against any earlier 1.x release.

History

Go was designed by Robert Griesemer, Rob Pike, and Ken Thompson at Google beginning in September 2007 and was announced publicly in November 2009. The first stable release, Go 1.0, shipped in March 2012 with the Go 1 compatibility promise — the commitment that programs written against Go 1 will continue to compile and run unchanged across subsequent 1.x releases. The language has been revised on an approximately six-month cadence since. Notable additions: Go 1.7 (2016) introduced the standard context package; Go 1.11 (2018) introduced modules as the official dependency-management mechanism, replacing the earlier GOPATH workspace model; Go 1.18 (2022) introduced generics — type parameters on functions and types — the most substantial addition to the language since its initial release; Go 1.21 (2023) standardised the slices, maps, and cmp packages built on generics. The current release is Go 1.24.

Hello world

package main

import "fmt"

func main() {
    fmt.Println("Hello, world!")
}

Build and execution with the standard toolchain:

go run hello.go        # compiles and runs in one step
go build hello.go      # produces an executable named hello
./hello

A complete project is organised as a module, declared by go.mod:

go mod init example.com/hello
go run .

The toolchain integrates dependency resolution (go get, go mod tidy), formatting (gofmt), static analysis (go vet), testing (go test), and benchmarking. The reference compiler is the gc toolchain distributed with the standard release; gccgo provides an alternative implementation through GCC. Cross-compilation is supported directly: GOOS=linux GOARCH=arm64 go build produces a binary for the named target without additional configuration.