Section 03

Environment & Tooling

Go ships as a single toolchain. go is the compiler, package manager, test runner, formatter, linter, and documentation generator. No pip vs conda vs poetry vs uv. One tool.

# Install Go (or use your OS package manager)
# https://go.dev/dl/

# Create a new project
mkdir my_project && cd my_project
go mod init github.com/you/my_project

# Build, run, test
go build ./...           # compile everything
go run main.go           # compile + run
go test ./...            # run all tests
go test -bench=. ./...   # run benchmarks
go fmt ./...             # auto-format (non-negotiable)
go vet ./...             # static analysis
go get github.com/pkg/x  # add a dependency
go doc fmt.Println       # view docs from terminal

Project Structure

Python
my_project/
├── pyproject.toml
├── src/
│   └── my_project/
│       ├── __init__.py
│       └── main.py
└── tests/
    └── test_main.py
Go
my_project/
├── go.mod          // module + dependencies
├── go.sum          // checksum lock file
├── main.go         // entry point
├── handler.go      // same package, same dir
├── handler_test.go // tests live next to code
└── internal/       // private packages
    └── store/
        └── store.go
go fmt Is Not Optional

Every Go project uses the same formatting. Tabs, not spaces. Specific brace placement. No debate, no config. go fmt rewrites your code in place. This is enforced culturally and by CI everywhere. Coming from Python's PEP 8 flexibility, this is jarring — then liberating.