Skip to content

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 L0 through //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

Conceptual Understanding

Organizational


Tutorials | How-to Guides | Explanation | Reference

You are here: Explanation — understanding-oriented discussion that clarifies concepts.