go-constructors
OfficialMaster Go constructors and APIs.
Software Engineering#design patterns#api design#golang#go#constructors#builder pattern#functional options
Authorgofhir
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill helps developers write cleaner, more flexible, and maintainable Go code by demonstrating various patterns for creating objects and configuring APIs.
Core Features & Use Cases
- Constructor Patterns: Covers simple
New*, panic-on-errorMustNew*, versioned constructors, option structs, functional options (WithX), and builder patterns. - API Design: Illustrates how to create configurable APIs and composite services.
- Use Case: When designing a new Go library, use this Skill to understand the best way to provide constructors that allow users to easily configure the library's behavior without breaking existing code.
Quick Start
Show me examples of using functional options to configure a Go struct.
Dependency Matrix
Required Modules
None requiredComponents
references
💻 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-constructors Download link: https://github.com/gofhir/validator/archive/main.zip#go-constructors 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.