go-test

Community

Write effective Go tests with standard patterns.

AuthorKubrickCode
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill provides a comprehensive guide for writing effective and maintainable Go tests using the standard testing package. It helps developers overcome challenges in test structure, mocking, and writing robust test cases, ensuring reliable code and faster development cycles.

Core Features & Use Cases

  • Standardized Test Structure: Defines file naming, hierarchy, and the Given-When-Then pattern for clarity.
  • Table-Driven Tests: Guides on using table-driven tests for efficient and comprehensive test case management.
  • Subtests & Benchmarks: Best practices for organizing tests with t.Run() and measuring performance with BenchmarkXxx.
  • Mocking Principles: Offers advice on interface-based dependency injection and manual mocking for isolated tests.
  • Use Case: A developer needs to write new unit or integration tests for a Go service, ensuring all edge cases are covered with idiomatic Go patterns.
  • Use Case: A team wants to improve the quality and consistency of their existing Go test suite, making it easier to understand and maintain.

Quick Start

Generate table-driven test cases for the attached calculator.go function, covering positive, negative, and zero inputs.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: go-test
Download link: https://github.com/KubrickCode/general/archive/main.zip#go-test

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.