Go Implementation Guide
Implementation-specific guide for Go/Godog BDD and testing
Complete guide for implementing BDD specifications with Go and Godog.
In This Section
| Topic | Description |
|---|---|
| Overview | Introduction to Go/Godog BDD testing |
| File Organization | Directory structure and file naming |
| Test Levels | Build tags and test isolation (L0-L4) |
| Step Definitions | Writing and organizing step definitions |
| Best Practices | Testing patterns and conventions |
Quick Reference
- Go version: ≥ 1.21
- Framework: Godog for BDD, Go test for unit tests
- Build tags:
//go:build L0through//go:build L4
Essential Commands
# Unit tests
go test ./... # L0 + L1
go test -tags=L0 ./... # L0 only
go test -tags=L2 ./... # L2 integration
# BDD scenarios
godog run # All scenarios
godog run --tags=@ov # Operational verification
godog run --tags=@cli # CLI features only
# Coverage
go test -cover ./...
go test -coverprofile=coverage.out ./...
go tool cover -html=coverage.out
Related Documentation
Conceptual Understanding
- Three-Layer Testing Approach - Conceptual overview
- BDD Fundamentals - BDD fundamentals
- Testing Taxonomy - Tag taxonomy concepts
Organizational
- Organizing Specifications - Specification structure
- Example Mapping - Requirements discovery
Tutorials | How-to Guides | Explanation | Reference
You are here: Explanation — understanding-oriented discussion that clarifies concepts.