Skip to content

Go

The Go toolchain — also the dependency that makes Hugo Modules work.

Homebrew formula Direct download

What it does

Go compiles statically linked binaries, manages dependencies through modules, and ships its own formatter, test runner and race detector. go build, go test, go vet and gofmt cover most of what other ecosystems need separate tools for.

Where else it shows up

Beyond writing Go, Hugo’s module system is Go’s module system. hugo mod get, hugo mod vendor and the imports block in hugo.yaml all delegate to the Go tool, so a Hugo site that pulls its theme as a module needs Go installed.

Notes

GOPATH defaults to ~/go, and go install drops binaries in ~/go/bin — add it to PATH or those tools appear to vanish.

Alternative to

AlternativeTypeTrade-off
RustOpen sourceThe other common choice for single-binary CLI tools and services, with a steeper curve
ZigOpen sourceYounger, lower-level, aimed at the C replacement niche rather than Go’s
Node.js or PythonOpen sourceQuicker to write, but they ship a runtime rather than one binary
Nothing, for Hugo Modules—That path resolves through the Go tool specifically, so it is a hard requirement rather than a choice

Install

brew install go

Links

This post is licensed under CC BY 4.0 by the author.
Last updated on