Cursor rule
.cursor/rules/go.mdc[object Object]
Cursor rules
Quality
86/100
Scores the file, not the repository.Length
332 words
11 headings · 0 code blocksRepository
0
— · pushed 336 days agoLast changed
3 days ago
First indexed 3 days ago.123456# Go Development Rules for Cursor78## Project Structure9- Use `cmd/${program}/main.go` for main applications10- Use `pkg/**/*.go` for shared libraries and packages11- Keep packages focused and cohesive1213## Build and Run Commands14- NO Make - use simple Go commands only15- Build: `go build ./cmd/har-mcp`16- Run: `go run ./cmd/har-mcp`17- Test: `go test ./...`18- Format: `go fmt ./...`19- Vet: `go vet ./...`20- Tidy dependencies: `go mod tidy`2122## Code Style23- Follow standard Go formatting with `gofmt`24- Use standard Go naming conventions (PascalCase for exported, camelCase for unexported)25- Keep functions and methods small and focused26- Use meaningful variable and function names27- Avoid unnecessary else clauses when using early returns2829## Coding30- You should have access to a godoc tool. Use it as much as possible31- Don't guess interfaces. Use the tools that you have to doublecheck what you are doing is correct3233## Testing34- Use github.com/stretchr/testify for assertions35- NO table-driven tests - use test helpers instead36- Test file naming: `*_test.go`37- Test function naming: `TestFunctionName`38- Use `require` for test setup that must succeed, `assert` for actual test assertions39- Create helper functions to reduce test duplication40- Test one thing per test function4142## Error Handling43- Always handle errors explicitly44- Use meaningful error messages45- Wrap errors with context using `fmt.Errorf("context: %w", err)`46- Return errors as the last return value4748## Dependencies49- Minimize external dependencies50- Use standard library when possible51- Pin dependency versions in go.mod5253## Comments54- Use godoc style comments for exported functions and types55- Comment explains WHY, not WHAT56- Keep comments concise and up-to-date5758## Performance59- Avoid premature optimization60- Profile before optimizing61- Use appropriate data structures62- Be mindful of memory allocations in hot paths6364## Concurrency65- Use channels for communication between goroutines66- Avoid shared mutable state67- Use context.Context for cancellation and timeouts68- Prefer composition over inheritance
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| TechSquidTV/Hermes.cursor/rules/10-hermes-api.mdc · 45 | Cursor rules | testlint-formatstylearch+5 | 100/100 | 3 days ago | |
| hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126 | Cursor rules | setupbuildtestlint-format+6 | 100/100 | 3 days ago | |
| langflow-ai/langflow.cursor/rules/docs_development.mdc · 153k | Cursor rules | setupbuildtestlint-format+7 | 97/100 | 3 days ago | |
| TechSquidTV/Hermes.cursor/rules/20-hermes-api-tests.mdc · 45 | Cursor rules | teststyletesting-strategysecurity+3 | 97/100 | 3 days ago | |
| skillrecordings/egghead-next.cursor/rules/project-update-rules.mdc · 1.4k | Cursor rules | buildtestlint-formatstyle+7 | 96/100 | 3 days ago | |
| skillrecordings/egghead-next.cursor/rules/project-update-user-rules.mdc · 1.4k | Cursor rules | buildtestlint-formatstyle+7 | 96/100 | 3 days ago | |
| nerds-odd-e/doughnut.cursor/rules/cli.mdc · 49 | Cursor rules | setupbuildteststyle+4 | 96/100 | 3 days ago | |
| hiromaily/go-crypto-wallet.cursor/rules/proto.mdc · 126 | Cursor rules | buildlint-formatstylearch+3 | 96/100 | 3 days ago |
