Rule
0 installs · 0 said it worked
Idiomatic Go coding rules for an expert Go developer assistant
A rules file that makes the model act as an expert Go developer, enforcing explicit error handling, idiomatic naming, interface-based design, context-first concurrency, and table-driven testing.
People use this for
- go coding rules file
- golang idiomatic code review
- go error handling prompt
- expert go developer assistant
- write go code with context concurrency
- Name
idiomatic-go-coding-rules-for-an-expert-go-developer-assistant- Works with
- Cursor
- License
- CC0(as observed at the source)
- Version
- v1 · updated Nov 29, 2026
Imported on Nov 29, 2026 from github.com . License observed at the source on Nov 29, 2026: CC0.
Are you the author?Claim this profileRequest removal
Use this rule
$ curl -fsSL "https://promptcommunity.dev/api/v1/posts/idiomatic-go-coding-rules-for-an-expert-go-developer-assistant-ap7n/export/mdc" -o .cursor/rules/idiomatic-go-coding-rules-for-an-expert-go-developer-assistant.mdcThen open a new session; Cursor picks it up from .cursor/rules/.
Manual install
Save idiomatic-go-coding-rules-for-an-expert-go-developer-assistant.mdc as .cursor/rules/idiomatic-go-coding-rules-for-an-expert-go-developer-assistant.mdc for this project or ~/.cursor/rules/idiomatic-go-coding-rules-for-an-expert-go-developer-assistant.mdc for every project, then start a new session.
Rule
description: "Idiomatic Go rules. Explicit error handling, interface-based design, context-first concurrency." globs: **/*.go alwaysApply: false
Go Language Rules
Expert Go developer. Simple, explicit, idiomatic.
Error Handling
- Always handle errors — never assign to _
- fmt.Errorf("context: %w", err) for wrapping
- errors.Is() / errors.As() for checking
- Custom error types for structured errors
Naming
- Short for short-lived vars: i, n, err, ok
- No stuttering: user.UserID → user.ID
- Acronyms: userID, httpClient (not userId, httpClient)
- Interfaces: end in -er (Reader, Writer, Handler)
Interfaces
- Accept interfaces, return concrete types
- Define at call site, not implementation site
- Single-method interfaces preferred
Concurrency
- context.Context first param for blocking functions
- defer cancel() after context creation
- WaitGroup for goroutine groups
- Channels for communication, Mutex for state
Testing
- Table-driven: for _, tc := range testCases { t.Run(tc.name, ...) }
- Interface-based mocking
Forbidden
- No _ to ignore errors
- No init() for business logic
- No global mutable state
- No interface{} where generics work
- No goroutines without termination condition
No result recorded yet. Added it? File a Tried-it report so the next person knows how it went in your editor.
Tried it
Reports from people who added this rule to their editor. They roll up into the badges above.
No one has filed a report yet. Try the prompt and be the first.
Related rules
- Claude api: reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming,…
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER — read BEFORE opening the target file; don't skip because it "looks like a one-liner" — whenever: the prompt names Claude/Anthropic in any fo
Coding · @anthropic
- Find silent exception-handling smells in Python code
Scans Python files offline with ast to flag bare or swallowed excepts, silent fallbacks, lost causes, and other error-hiding patterns, returning file:line findings with severity and fix recipes.
Coding · @f
- Explain, test, and harden a Python regular expression
Explains a Python regex token by token, tests it against must-match and must-not-match samples, flags risky patterns like catastrophic backtracking, and returns a safer rewrite with a test table.
Coding · @f
- SQL Index Recommendation Reviewer for slow queries and schemas
Reviews a schema and slow SQL queries, proposes composite indexes in the right column order, flags non-sargable filters, and warns about duplicate, redundant, and low-selectivity indexes, with a stdlib Python helper.
Data & Finance · @f
- Autonomous coding agent that builds a verified app-builder harness
Master system prompt that directs an autonomous senior Python engineer to build a spec-driven, evidence-traced app-builder harness milestone by milestone without asking questions.
Coding · @mahfuzahmedog
License: CC0v1 · published Nov 29, 2026
Comments
No comments yet. If you tried this prompt, say how it went.