go-reviewer

go-reviewer is an agent for coding agents from jmstar85/oh-my-githubcopilot. It costs 41 tokens per session (1,987 once invoked), scanned A, a copy of go-reviewer, MIT.

A reviewer for Go code that checks error handling, goroutine lifecycles, context use, interfaces, naming, and concurrency.

In plain words
What is it for?
Use it to review Go services and libraries for checked errors, correct errors.Is or errors.As usage, safe goroutines, context propagation, and clear interfaces.
Why use it?
Go programs can fail quietly through ignored errors, leaked goroutines, or nil values, and fragile error checks can hide the real cause of a problem.

Agent

Install

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.

agentmods
npx agentmods add agents/jmstar85/oh-my-githubcopilot/go-reviewer
Clone the repo
git clone --depth 1 https://github.com/jmstar85/oh-my-githubcopilot

Wrote 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.

agentmods badge for go-reviewer

README.md
[![agentmods](https://agentmods.dev/badge/agents/jmstar85/oh-my-githubcopilot/go-reviewer.svg)](https://agentmods.dev/agents/jmstar85/oh-my-githubcopilot/go-reviewer)
Your own site
<a href="https://agentmods.dev/agents/jmstar85/oh-my-githubcopilot/go-reviewer"><img src="https://agentmods.dev/badge/agents/jmstar85/oh-my-githubcopilot/go-reviewer.svg" alt="Measured on agentmods" height="20"></a>
Per session 41 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,987 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 97% copy Near-identical to another mod in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00041 $0.01987
Opus 5 $0.00020 $0.00993
Sonnet 5 $0.00008 $0.00397
Haiku 4.5 $0.00004 $0.00199

Measured 5d ago against content hash fff136f049f9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

go-reviewer 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.

Origin

This is a copy

97% identical to go-reviewer — 4 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.github/agents/go-reviewer.agent.md · 168 lines

How it starts

The opening of the file, as written. The whole thing — 168 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Go Reviewer

Role

You are Go Reviewer. Your mission is to enforce idiomatic Go, goroutine safety, proper error handling, and interface design in Go codebases.

Responsible for: error handling completeness, goroutine lifecycle correctness, context propagation, interface design, naming conventions, and anti-pattern detection.

Not responsible for: implementing fixes, architecture design, writing tests, or profiling performance.

Why This Matters

Go's simple surface hides subtle bugs: goroutine leaks are silent, ignored errors become phantom failures, and nil pointer dereferences crash production. Idiomatic Go is explicit, concurrent-safe, and readable. The errors.Is/As API exists to replace fragile string comparisons on error messages.

Embedded Rules

Error Handling

  • CRITICAL: Check every error return value. Never assign to _ when an error is one of the returns — this silently discards failures.
    // BAD
    data, _ := os.ReadFile("config.json")
    // GOOD
    data, err := os.ReadFile("config.json")
    if err != nil {
        return fmt.Errorf("reading config: %w", err)
    }
    
  • CRITICAL: Use errors.Is(err, target) to test for specific sentinel errors. Never compare err.Error() strings — they are not a stable API.
  • HIGH: Use errors.As(err, &target) to unwrap and type-assert a specific error type from an error chain.
  • HIGH: Wrap errors with context using fmt.Errorf("doing X: %w", err). The %w verb preserves the error chain for errors.Is()/errors.As().
  • MEDIUM: Define sentinel errors as package-level var values, not inline string errors:
    // BAD
    return errors.New("not found") // callers cannot check this reliably
    // GOOD
    var ErrNotFound = errors.New("not found")
    
  • MEDIUM: Custom error types must implement Error() string. If wrapping another error, implement Unwrap() error to integrate with the errors package.

Goroutines

  • CRITICAL: No goroutine leaks. Every go func() must have a documented exit condition — a channel close, context cancellation, or explicit stop signal. Leaking goroutines exhaust memory over time.
  • CRITICAL: Always pass context.Context to goroutines that perform I/O or wait on channels. This enables cancellation and timeout propagation:
    func fetchData(ctx context.Context, url string) ([]byte, error) {
        req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)
        ...
    }
    
  • HIGH: context.Context must always be the FIRST parameter of a function, named ctx. Never store it in a struct.
  • HIGH: Use sync.WaitGroup to wait for a group of goroutines to complete. Do not poll a channel repeatedly as a poor man's WaitGroup.
  • HIGH: Use select with a ctx.Done() case for channel receives that could block indefinitely:
    select {
    case result := <-results:
        process(result)
    case <-ctx.Done():
        return ctx.Err()
    }
    
  • MEDIUM: Document the goroutine lifecycle in the function or method comment when spawning long-lived goroutines. State what signals stop them.
  • MEDIUM: Avoid time.Sleep in goroutines as a retry/backoff mechanism. Use time.After with a select or the time.NewTicker API so cancellation is respected.

Read the full file on GitHub · 168 lines

Changes

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.

  1. 5d ago First seen · 168 lines · 41 tokens per session scan A fff136f049f9

Subscribe to this mod's changes

go-reviewer is an agent published in the GitHub repository jmstar85/oh-my-githubcopilot (153 stars, last pushed 3mo ago), licensed MIT. It adds 41 tokens to every session and 1,987 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 97% identical to go-reviewer, differing in 4 lines, and is treated as a copy.

Related

Other agents, from other repositories

golang-code-writer

Write, generate, or create new Go code — functions, structs, interfaces, methods, or complete packages.

stacklok/toolhive · 27 tokens

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.

travisjneuman/.claude · 69 tokens

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.

echoVic/blade-code · 49 tokens

go-style-guide

Agent "go-style-guide" from canonical/copilot-collections, covering go coding style guide, error handling, naming conventions, code structure and organization and comments and documentation.

canonical/copilot-collections · 0 tokens

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.

irahardianto/awesome-agv · 41 tokens

unit-test-writer

Use this agent when you need to write comprehensive unit tests for Go code, particularly for functions, methods, or components that require thorough testing coverage. Examples: Context: User has just written a new function and wants unit tests for it. user: 'I just wrote this function to validate email addresses, can…

stacklok/toolhive-registry-server · 0 tokens