mockery-generate
CommunityStandardize Go mocks with mockery and go:generate
System Documentation
What problem does it solve?
This Skill standardizes and automates the generation of mocks for Go interfaces using mockery and go:generate, eliminating manual mock implementations and keeping tests consistent.
Core Features & Use Cases
- Automatically annotate interfaces with go:generate mockery --name=<Interface> --with-expecter=true
- Enforce generation of mocks into a mocks subpackage next to the interface
- Provide testing-ready mocks that are imported and used in unit tests
Quick Start
Identify the interfaces to mock, replace or ensure the go:generate line above each interface, e.g. go:generate mockery --name=YourInterface --with-expecter=true Run go generate ./... to generate or update mocks In tests, import the generated mocks from the mocks package and use the provided New... constructors and EXPECT to configure behaviors
Dependency Matrix
Required Modules
None requiredComponents
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: mockery-generate Download link: https://github.com/EricOo0/stock-trading-platform/archive/main.zip#mockery-generate Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 223,000+ vetted skills library on demand.