zc-workstationDocumentation PDF GitHub

Go tools

Go, gopls, delve and golangci-lint: the Go toolchain and the tools around it.

.md

Go builds zc-workstation itself. Homebrew installs the toolchain and three tools that editors and AI agents lean on: gopls, the language server; delve, the debugger; and golangci-lint, the linter that also enforces which package may import which.

On the workstation

  • Installed by the go, gopls, delve and golangci-lint formulae.

  • Code generators a project needs, such as sqlc or oapi-codegen, are pinned with a tool directive in that project’s go.mod and run through go tool, never installed globally.

  • A project drives everything through make: make lint, make test, make build. The targets wire up the flags that raw commands miss.

  • VS Code and Claude Code find gopls on PATH, so both get the same definitions, references and diagnostics.

Keys and commands

Key or command Does

go test ./internal/plan -run TestName

Run one test

go test -race ./…​

Run every test with the race detector

go tool <name>

Run a tool pinned in go.mod

go get -tool example.com/cmd@v1.2.3

Pin a tool in go.mod

golangci-lint run

Lint with the project’s .golangci.yml

dlv test ./internal/plan

Debug the tests of one package

dlv debug ./cmd/app — plan

Debug a program with its arguments

gopls check file.go

Print a file’s diagnostics, as an editor sees them

With zc-workstation

The repository’s .golangci.yml turns on depguard with rules such as plan-performs-no-io: the plan package may not import net/http or run a command. make lint fails when one of these import boundaries is crossed, before review sees it.

$ make lint
go vet ./...
0 issues.

Edit this page Last updated

Keyboard shortcuts

Ctrl/⌘ K or /
Search the docs
↑ ↓ Enter
Move through the search results
← →
Previous or next page
f
Filter the pages in the sidebar
g h
Home
t
Cycle the theme
?
This list
Esc
Close a menu or the search results