go-testing

Automate Go test case development with templates, helpers, and mocks.

2|Updated Jan 7, 2026
One-click install
npx skills add https://github.com/Integralist/agent-skills --skill go-testing-integralist
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-testing
Source: https://github.com/Integralist/agent-skills/tree/main/.agents/skills/go-testing
Command: npx skills add https://github.com/Integralist/agent-skills --skill go-testing-integralist

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

The go-testing Skill solves the problem of manually creating and updating tests in Go services. It streamlines the process of writing unit and integration tests, including mocks, fuzz tests, and benchmarks.

Core Features & Use Cases

  • Unit and Integration Testing: Facilitates the creation of unit and integration tests in Go services.
  • Test Templates: Provides pre-defined test templates for table-driven and F-tests.
  • Test Helpers: Offers helper functions for common testing tasks.
  • HTTP Handler Tests: Supports testing HTTP handlers with the httptest package.
  • Mocking: Incorporates the use of testify/mock for creating mocks.
  • Assertions: Recommends the use of standard library assertions and testify/assert.
  • Integration and Fuzz Tests: Supports writing integration and fuzz tests for complete workflows and edge case discovery.
  • Benchmarks: Provides guidance on creating and running benchmarks to measure performance.
  • Use Case: If you're developing a Go service and need to write comprehensive tests, this Skill offers a structured approach to testing your code efficiently.

Quick Start

Execute the following command to run all unit tests for your Go service: make test.

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 services?

Table-driven tests in Go are created using pre-defined templates that structure test cases efficiently. This approach automates repetitive case definitions to enhance code quality and maintainability across your services.

How do I create mocks for Go unit tests?

Mocks for Go unit tests are created using the `testify/mock` package. This approach allows you to isolate dependencies and simulate interactions, ensuring comprehensive test coverage for your services.

Does this testing approach support HTTP handler tests in Go?

Yes, HTTP handler tests in Go are supported using the `httptest` package. This allows you to simulate HTTP requests and responses to verify that your web handlers process requests correctly and maintain expected behavior.

What is the best way to write benchmarks in Go?

The best way to write benchmarks in Go is to use provided guidance on creating and running performance tests. This measures code execution efficiency directly within the testing framework to identify bottlenecks and validate optimizations.

How do I write fuzz tests for edge case discovery in Go?

Fuzz tests for edge case discovery in Go are written by providing random data inputs to your functions. This testing paradigm exposes complete workflow vulnerabilities and unexpected crashes by continuously mutating input values.

Do I need the standard library testing package to run integration tests in Go?

Yes, the standard library `testing` package is required for basic test functionality, including integration tests. It provides the foundational framework needed to execute test suites and verify complete service workflows.