Skip to content

Commit bb84ab3

Browse files
committed
Add rules/go-production/.cursorrules
1 parent 855aa51 commit bb84ab3

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

rules/go-production/.cursorrules

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.cursorrules — Go Production
2+
3+
- Never ignore returned error with _. Handle or return every error.
4+
- Wrap with context: fmt.Errorf("functionName: %w", err).
5+
- Define interfaces at the consumer package. Keep interfaces to 1-2 methods.
6+
- ctx context.Context as first parameter in every I/O function.
7+
- Every goroutine has a clear owner and shutdown path. Use errgroup.
8+
- Always name struct fields. No positional initialization.
9+
- Table-driven tests with t.Run(tt.name, ...).

0 commit comments

Comments
 (0)