go-testing

Generate table-driven Go tests for unit, integration, and TUI applications.

1|Updated Dec 30, 2025
One-click install
npx skills add https://github.com/statick88/dotfiles --skill go-testing-statick88
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-testing
Source: https://github.com/statick88/dotfiles/tree/main/opencode/skills/go-testing
Command: npx skills add https://github.com/statick88/dotfiles --skill go-testing-statick88

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance and examples for writing effective Go tests, covering unit, integration, and TUI testing patterns.

Core Features & Use Cases

  • Table-Driven Tests: Efficiently test multiple input/output scenarios.
  • Bubbletea TUI Testing: Techniques for testing interactive terminal applications.
  • Golden File Testing: Ensure consistent output by comparing against reference files.
  • Use Case: When developing a new Go application, use this Skill to implement robust testing strategies from the start, ensuring code quality and maintainability.

Quick Start

Use the go-testing skill to generate a table-driven test for a Go function.

Frequently Asked Questions about go-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write table-driven tests in Go for multiple input scenarios?

Table-driven tests in Go allow you to efficiently test multiple input and output scenarios using a single test function. You define test cases in a struct slice and iterate through them to execute assertions and verify expected behavior.

What is the best way to test interactive Bubbletea TUI applications in Go?

Testing Bubbletea TUI applications is done using teatest to validate interactive terminal components. This approach allows you to simulate user input and verify terminal output to ensure your Go TUI behaves correctly.

How does golden file testing work for validating Go application output?

Golden file testing ensures consistent output by comparing your Go application's actual output against saved reference files. If the output changes, the test fails and you can update the golden file to match the new expected state.

How do I organize unit and integration tests in a Go project?

Organizing Go tests involves using decision trees and command examples to separate unit tests from integration tests. This strategy ensures efficient test development and maintainable code structure across different testing scopes.

Can I use this Go testing guidance for a new application from scratch?

Yes, you can use these Go testing patterns to implement robust testing strategies from the start of a new application. It covers best practices for unit, integration, and TUI testing to ensure code quality and maintainability.