Skip to content

Commit a3c0556

Browse files
vojtabiberleclaude
andcommitted
Add t.Context() guideline to CLAUDE.md
Document that tests should use t.Context() instead of context.Background() as Go 1.21+ provides test context that is automatically cancelled when the test ends. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent bb01f73 commit a3c0556

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ Services auto-reload on code changes using Air.
146146
- Coverage target: 80%
147147
- E2E tests use real etcd and mocked HTTP clients
148148
- Test projects configured via `.env` file pointing to `projects.json`
149+
- **Use `t.Context()` instead of `context.Background()`** - Go 1.21+ provides test context via `t.Context()` which is automatically cancelled when the test ends
149150

150151
## State Management Architecture
151152

0 commit comments

Comments
 (0)