go-unit-tests

Generate Go unit tests using testify patterns and Arrange-Act-Assert style.

Updated Jan 4, 2026
One-click install
npx skills add https://github.com/cristiano-pacheco/ai-rules --skill go-unit-tests
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: go-unit-tests
Source: https://github.com/cristiano-pacheco/ai-rules/tree/main/skills/go-unit-tests
Command: npx skills add https://github.com/cristiano-pacheco/ai-rules --skill go-unit-tests

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Generate comprehensive Go unit tests following testify patterns and best practices. Use when creating or updating Go test files, writing test suites for structs with dependencies, testing standalone functions, working with mocks, or when asked to add test coverage for Go code.

Core Features & Use Cases

  • Tests generation patterns for struct-based tests with dependencies using testify's suite.
  • Standalone function tests with Arrange-Act-Assert style.
  • Mocks wiring guidance and naming conventions for Go tests.

Quick Start

Create a Go test file scaffold for a package, using testify patterns to cover typical cases.

Frequently Asked Questions about go-unit-tests

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

FAQPage Schema
How do I generate Go unit tests using testify for structs with dependencies?

Generate Go unit tests using testify by creating test suites for structs with dependencies, applying industry-standard naming conventions and AAA (Arrange-Act-Assert) style to ensure comprehensive coverage.

What is the best way to write standalone function tests in Go with Arrange-Act-Assert style?

Standalone function tests in Go are best written using the Arrange-Act-Assert style, separating test setup, execution, and verification phases to improve readability and maintainability.

How do I wire mocks in Go unit tests using testify?

Wire mocks in Go unit tests by following testify patterns and best practices, utilizing specific naming conventions and mock structures to simulate dependencies accurately.

Can I use testify to add test coverage for an existing Go project?

Yes, you can expand test coverage across a Go project using testify patterns, generating comprehensive unit tests for standalone functions, structs with dependencies, and mocks.

Does generating Go unit tests require specific naming conventions for test files?

Generating Go unit tests requires industry-standard naming conventions for test files, ensuring consistent structure and readability across test suites and mock implementations.