Canonical Copilot Collections is a repository for organizing and distributing GitHub Copilot instructions, prompts, agents, and skills across Canonical repositories. Teams configure repositories to subscribe to shared collections, such as Python, documentation, or Juju development guidance, and keep those assets synchronized.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add agents/canonical/copilot-collections/go-style-guidegit clone --depth 1 https://github.com/canonical/copilot-collectionsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/agents/canonical/copilot-collections/go-style-guide)<a href="https://agentmods.dev/agents/canonical/copilot-collections/go-style-guide"><img src="https://agentmods.dev/badge/agents/canonical/copilot-collections/go-style-guide.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.07771 |
| Opus 5 | $0.00000 | $0.03886 |
| Sonnet 5 | $0.00000 | $0.01554 |
| Haiku 4.5 | $0.00000 | $0.00777 |
Grade A, and why
go-style-guide scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 1,484 lines — stays where its author put it; the contents beside it link to each section on GitHub.
:orphan:
.. meta::
:description: Go coding style guide covering error handling, naming
conventions, code structure, testing patterns, and architecture
principles derived from PR discussions and contribution standards.
Go coding style guide
This style guide documents Go-specific coding conventions used in the project. It captures patterns from code review discussions in merged PRs and established project standards. These guidelines complement general coding standards for your organization with project-specific decisions.
The guide is evidence-based, derived from actual PR discussions between maintainers (primarily @dmitry-lyfar and @jonathan-conder) during code reviews.
Error handling
Error message format
Pattern: Error messages start lowercase, contain no trailing punctuation, and follow the template: "what was attempted: why it went wrong".
Exception: Proper nouns (like "COMPONENT", "SERVICE") may start with a capital letter.
Rationale: Maintains consistency with existing error handling patterns and provides clear, actionable user guidance.
Good:
// From cmd/tool/connect.go
return fmt.Errorf("cannot connect plugs and slots across different environments")
// From cmd/tool/list.go
return fmt.Errorf("cannot list: \"--project\" incompatible with \"--global\"")
// From internal/daemon/api_environments.go
return statusBadRequest("project-id required")
Avoid:
return fmt.Errorf("Cannot connect plugs.") // Starts with capital, has punctuation
return fmt.Errorf("Error") // Not descriptive enough
Error specificity
Pattern: Return specific errors where possible to allow callers to handle them appropriately.
Good:
if _, err := os.Stat(path); err != nil {
if os.IsNotExist(err) {
// Handle file not found specifically
return fmt.Errorf("configuration file %q not found", path)
}
return fmt.Errorf("cannot access configuration file %q: %w", path, err)
}
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 5d ago First seen · 1,484 lines · 0 tokens per session scan A 54e1a81f17f8
go-style-guide is an agent published in the GitHub repository canonical/copilot-collections (29 stars, last pushed 2d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 7,771 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other agents, from other repositories
golang-code-writer
Write, generate, or create new Go code — functions, structs, interfaces, methods, or complete packages.
go-expert
Go concurrency, error handling, stdlib patterns, Chi/Echo web frameworks specialist. Use when writing Go code, designing concurrent systems, or building Go web services. Trigger phrases: Go, Golang, goroutine, channel, Chi, Echo, stdlib, context, error handling, interface, module, go test.
golang-pro
Write idiomatic Go code with goroutines, channels, and interfaces. Optimizes concurrency, implements Go patterns, and ensures proper error handling. Use PROACTIVELY for Go refactoring, concurrency issues, or performance optimization.
backend-engineer
Senior backend engineer for Go API development. Invoke for API handlers, business logic, data access, concurrency patterns, observability, and backend implementation. Writes production code using TDD workflow.
code-reviewer
Go code review specialist. Proactively reviews code for quality, DDD compliance, idioms, and security. Use immediately after writing or modifying code.
doc-updater
Go documentation specialist. Updates README, godoc comments, and usage documentation. Keeps docs in sync with code. Japanese documentation is canonical (README.ja.md, docs/.ja.md).