go-functional-options
✓The functional options pattern for Go constructors and public APIs. Use when designing APIs with optional configuration, especially with 3+ parameters.
Installation
SKILL.md
Functional options is a pattern where you declare an opaque Option type that records information in an internal struct. The constructor accepts a variadic number of these options and applies them to configure the result.
The unexported apply method ensures only options from this package can be used.
| Extensibility | Add new With functions | Add new fields (may break) | | Defaults | Built into constructor | Zero values or separate defaults | | Caller experience | Only specify what differs | Must construct entire struct | | Testability | Options are comparable | Struct comparison | | Complexity | More boilerplate | Simpler setup |
The functional options pattern for Go constructors and public APIs. Use when designing APIs with optional configuration, especially with 3+ parameters. Source: cxuu/golang-skills.
Facts (cite-ready)
Stable fields and commands for AI/search citations.
- Install command
npx skills add https://github.com/cxuu/golang-skills --skill go-functional-options- Source
- cxuu/golang-skills
- Category
- </>Dev Tools
- Verified
- ✓
- First Seen
- 2026-02-01
- Updated
- 2026-02-18
Quick answers
What is go-functional-options?
The functional options pattern for Go constructors and public APIs. Use when designing APIs with optional configuration, especially with 3+ parameters. Source: cxuu/golang-skills.
How do I install go-functional-options?
Open your terminal or command line tool (Terminal, iTerm, Windows Terminal, etc.) Copy and run this command: npx skills add https://github.com/cxuu/golang-skills --skill go-functional-options Once installed, the skill will be automatically configured in your AI coding environment and ready to use in Claude Code or Cursor
Where is the source repository?
https://github.com/cxuu/golang-skills
Details
- Category
- </>Dev Tools
- Source
- skills.sh
- First Seen
- 2026-02-01