What Is Go?

A small, fast, compiled language designed at Google for networked services, tools and cloud infrastructure.

Go (often called Golang) was designed at Google by Robert Griesemer, Rob Pike and Ken Thompson, announced in 2009 and released as 1.0 in 2012. It aims for simplicity: a small language that compiles in seconds to a single static binary, with garbage collection, built-in concurrency (goroutines and channels) and an excellent standard library. Docker, Kubernetes, Terraform, Prometheus and much of today's cloud infrastructure are written in Go.

First program

package main and func main mark an executable program.

import brings in standard-library packages: fmt for formatting, runtime for information about the program.:= declares variables and infers their types.

Printf verbs: %s string, %d integer, %6.2f float, %x hex, %v any value in its default format.

Why engineers choose Go

func main() {... } Go inserts semicolons at line ends, so an opening brace on its own line is a syntax error. go fmt enforces the standard style.

How do you build a Linux ARM64 binary on Windows?

Set GOOS=linux and GOARCH=arm64 and run go build; Go cross-compiles without extra toolchains (for pure Go code).