Skip to main content
Back to registry

go-functional-options

cxuu/golang-skills

Installs170
Install command
npx skills add https://github.com/cxuu/golang-skills --skill go-functional-options
Security audits
Gen Agent Trust HubPASS
SocketPASS
SnykPASS
About this skill
Source : Uber Go Style Guide 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. Use functional options when: The unexported apply method ensures only options from this package can be used. Source : Uber Go Style Guide Source : Uber Go Style Guide Prefer Config Struct when : Fewer than 3 options, options rarely change, all options usually specified together, or internal APIs only. Source : Uber Go Style Guide An alternative implementation uses closures: The interface approach is preferred because: - 3+ optional arguments on constructors or public APIs - Extensible APIs that may gain new options over time - Clean caller experience is important (no need to pass defaults) - Unexported options struct - holds all configuration - Exported Option interface - with unexported apply method - Option types - implement the interface - With* constructors - create options - Testability - Options can be compared in tests and mocks - Debuggability - Options can implement fmt.Stringer - Flexibility - Options can implement additional interfaces - Visibility - Option types are visible in documentation - go-style-core - Core Go style principles - go-naming - Naming conventions for Go - go-defensive - Defensive programming patterns...

Source description provided by the upstream skill listing. Community reviews and install context appear in the sections below.

Community Reviews

Latest reviews

Sign in to review

No community reviews yet. Be the first to review.

Browse this skill in context
FAQ
What does go-functional-options do?

go-functional-options is listed in SkillJury, but the source summary is still sparse.

Is go-functional-options good?

go-functional-options does not have approved reviews yet, so SkillJury cannot publish a community verdict.

What agent does go-functional-options work with?

go-functional-options currently lists compatibility with codex, gemini-cli, opencode, cursor, kimi-cli, amp, github-copilot.

What are alternatives to go-functional-options?

Skills in the same category include telegram-bot-builder, flutter-app-size, sharp-edges, iterative-retrieval.

How do I install go-functional-options?

npx skills add https://github.com/cxuu/golang-skills --skill go-functional-options

Related skills

More from cxuu/golang-skills

Related skills

Alternatives in Software Engineering