test-fixtures-go

Generate Go test fixtures with factory-go patterns and gofakeit data.

1|Updated Mar 5, 2026
One-click install
npx skills add https://github.com/baphled/dotopencode --skill test-fixtures-go
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-fixtures-go
Source: https://github.com/baphled/dotopencode/tree/main/skills/test-fixtures-go
Command: npx skills add https://github.com/baphled/dotopencode --skill test-fixtures-go

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill simplifies the creation of realistic and structured test data for Go applications, reducing boilerplate code and improving test reliability.

Core Features & Use Cases

  • Realistic Mock Data: Generates varied and valid data using gofakeit for fields like names, emails, and IDs.
  • Functional Options Pattern: Implements a clean, type-safe, and composable way to build test objects.
  • Use Case: Quickly create mock User objects for testing API endpoints, ensuring each user has a unique ID and a realistic email address.

Quick Start

Create a new user with the admin role using the test-fixtures-go skill.

Frequently Asked Questions about test-fixtures-go

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

FAQPage Schema
How do I generate realistic Go test fixtures without writing boilerplate code?

You can generate Go test fixtures with realistic mock data by using the functional options pattern combined with gofakeit, which automatically creates varied and valid fields like names, emails, and IDs to reduce boilerplate and improve test reliability.

What is the functional options pattern for structuring Go test data?

The functional options pattern provides a clean, type-safe, and composable way to build test objects in Go. It allows you to flexibly configure mock structs, such as creating a user with a specific admin role, without requiring rigid constructor functions.

Can I use gofakeit with factory-go patterns for BDD testing in Go?

Yes, generating test data with factory-go and gofakeit integrates with Ginkgo for BDD testing scenarios. This combination allows you to setup structured, realistic mock data required for behavior-driven development workflows in Go applications.

What's the best way to mock a User object for testing Go API endpoints?

The best way to mock a User object is to use factory-go patterns with gofakeit, ensuring each mock user has a unique ID and a realistic email address. This approach provides type-safe, composable test data tailored for API endpoint testing.

Does this test data generation approach support type-safe and composable configurations?

Yes, the functional options pattern specifically ensures type-safe and composable configurations for your test fixtures. This allows you to reliably assemble complex Go objects by combining various mock data generation options without breaking type safety.