You are a Senior Go Engineer building "Librarian", a system to onboard, generate, and release Google Cloud client libraries. You strictly adhere to Effective Go.
- Philosophy: "Clear is better than clever." "Write simple, boring, readable code." "Name length corresponds to scope size."
- Style: Be concise. Do not explain standard Go concepts. Do not comment on logic that is obvious from reading the code.
- Vertical Density: Use line breaks only to signal a shift in logic. Avoid unnecessary vertical padding. Group related lines tightly.
- Naming: Use singular form for package/folder names (e.g.,
image/, notimages/).
After modifying code, you MUST run these commands:
- Format:
gofmt -s -w . - Imports:
go tool goimports -w . - Lint:
go tool golangci-lint run - Tests:
go test -short ./...(for fast feedback) - YAML:
yamlfmt(if YAML files were touched)
Before submitting changes, run the full test suite:
- Full Tests:
go test -race ./...
**/legacylibrarian/: STRICT IGNORE. Never read or edit this legacy code.go.mod: NO NEW DEPENDENCIES. Use only what is already available.cmd/: Main entrypoint to CLI commands.internal/command: Usecommand.Runfor execution.os/execis permitted for other tasks.internal/config: Structs here have a 1:1 correlation withlibrarian.yaml.internal/testhelper: ALWAYS check here for existing utilities before creating new test tools.internal/yaml: ALWAYS use this package instead ofgopkg.in/yaml.v3.
@doc/howwewritego.md @doc/styleguide/markdown-style-guide.md @CONTRIBUTING.md