32 lines
457 B
Markdown
32 lines
457 B
Markdown
|
|
---
|
||
|
|
paths:
|
||
|
|
- "**/*.go"
|
||
|
|
- "**/go.mod"
|
||
|
|
- "**/go.sum"
|
||
|
|
---
|
||
|
|
# Go Testing
|
||
|
|
|
||
|
|
> This file extends [common/testing.md](../common/testing.md) with Go specific content.
|
||
|
|
|
||
|
|
## Framework
|
||
|
|
|
||
|
|
Use the standard `go test` with **table-driven tests**.
|
||
|
|
|
||
|
|
## Race Detection
|
||
|
|
|
||
|
|
Always run with the `-race` flag:
|
||
|
|
|
||
|
|
```bash
|
||
|
|
go test -race ./...
|
||
|
|
```
|
||
|
|
|
||
|
|
## Coverage
|
||
|
|
|
||
|
|
```bash
|
||
|
|
go test -cover ./...
|
||
|
|
```
|
||
|
|
|
||
|
|
## Reference
|
||
|
|
|
||
|
|
See skill: `golang-testing` for detailed Go testing patterns and helpers.
|