Go runtime
The support code the compiler builds into every Go program, which schedules goroutines, manages memory and collects garbage.
In more detail
Other languages often need a runtime installed on the machine; Go links it into the binary, so there is nothing extra to install. The runtime package lets a program ask about it, for example runtime.GOOS and runtime.GOARCH report the platform the binary was built for.
Example
fmt.Println(runtime.GOOS, runtime.GOARCH)Related terms
- garbage collection — The automatic freeing of memory held by objects that the program can no longer reach.
- goroutine — A function running concurrently with the rest of a Go program, started by putting the go keyword before a call.
- Go scheduler — The part of the Go runtime that decides which goroutine runs on which operating system thread, and when.
- GOOS and GOARCH — The two Go settings that choose the target operating system and processor family a build produces a binary for.
- language runtime — The software a programming language needs installed to run programs, such as the Python interpreter or Node.js.
Taught in
- What Go Is and Why It Matters — Concurrent Systems Programming with Go
- Building Static Binaries — Concurrent Systems Programming with Go