TableDrivenTests
Short practical reference for idiomatic table-driven test structure in Go.
Short practical reference for idiomatic table-driven test structure in Go.
- Author: Go Team
- Authority: primary
- Kind: wiki
- URL: https://go.dev/wiki/TableDrivenTests
What it covers
- table-driven test layout
- test case structure
- relationship with subtests
Why authoritative
Go Team wiki guidance for the most common Go test organization pattern.
Use when
- how should I structure table-driven tests in Go
- is this table-driven test idiomatic
- should these test cases be subtests
Keywords
- table-driven tests, testing, cases, subtests, idiomatic