Learn Go from Python¶
A personal, opinionated set of conspect notes for a Python developer picking up Go. The goal is to explain Go on its own terms, with short Python analogies thrown in only when they sharpen the contrast.
All material targets the current stable Go release, Go 1.26.4.
How the notes are organised¶
Each topic is a numbered folder. Inside each folder, conspects and runnable code examples share one numeric sequence so the reading order is always obvious.
Ecosystem and installation¶
- What is Go — the language, the community, the ecosystem.
- The
gocommand — every subcommand you'll touch. go tool trace— the execution tracer.- File types —
.go,_test.go,go.mod,go.sum, build constraints. - Special folders —
internal/,testdata/, conventions. - Multiple Go versions —
GOTOOLCHAIN, thegoandtoolchaindirectives. - Installation — macOS, Linux, Windows.
- Additional tools —
gopls,dlv,golangci-lint, and friends. - Demo project — a small runnable module that exercises the above.
Language basics¶
- Variables and constants
- Basic types
- Type conversions
- Operators
- Control flow
- Defer
- Custom types
- Imports
Source¶
- Source repository: https://github.com/oduvan/learn-go-from-python.
- Each conspect cites the official sources it consulted at the bottom of the page — typically go.dev, pkg.go.dev, or the Go specification.