SKILL

golang-patterns

Go-specific design patterns and best practices including functional options, small interfaces, dependency injection, concurrency patterns, error handling, and package organization. Use when working with Go code to apply idiomatic Go patterns.

Target: Design & content creation. Automatically collected · unverified.

Excerpt from the author’s documentation

Extracted from a fixed version of SKILL.md in its original language. This is the author’s documentation; installation, compatibility and runtime results have not been verified by this site.

Read the original English text

Topics in the source

  • Go Patterns
  • Functional Options
  • Small Interfaces
  • Dependency Injection
  • Concurrency Patterns
  • Worker Pool
  • Context Propagation
  • Error Handling

This skill provides comprehensive Go patterns extending common design principles with Go-specific idioms. Use the functional options pattern for flexible constructor configuration: Benefits: Backward compatible API evolution Optional parameters with defaults Self-documenting configuration Define interfaces where they are used, not where they are implemented. Principle: Accept interfaces, return structs Benefits: Easier testing and mocking Loose coupling Clear dependencies Use constructor functions to inject dependencies: Pattern: Constructor functions (New prefix) Explicit dependencies as parameters Return concrete types Validate dependencies in constructor Always pass context as first parameter: Package names: lowercase, single word Avoid stutter: user.User not user.UserModel Use internal/ for private code Keep main package minimal Designing Go APIs and packages Implementing concurrent systems Structuring Go projects Writing idiomatic Go code Refactoring Go codebases

Source repository
affaan-m/ECC
Source file
.kiro/skills/golang-patterns/SKILL.md
Fixed revision
d2ef2680594f9a17526a6e1a2e18b3d242c5d17b
Read the complete original documentation ↗

Requirements

  • Only the author’s Skill metadata is included. Read the full instructions to check dependencies, licensing and conditions of use.

A small first task

先阅读原作者说明,再决定是否在自己的 AI 工具中使用。

Instructions for your AI tool

Author documentation is not live verification by this site. Without evidence, we do not mark a resource as compatible, safe or free.

Sources and evidence

This record was collected automatically. Its documentation, suitability and runtime behavior have not been manually verified.

Author: affaan-m/ECC · original repository metadata. Documentation review: Not reviewed. Last source check: 2026-11-09T14:01:48.602Z.

Categories are inferred from names, descriptions and paths. They do not establish compatibility.

License and attribution

MIT. Third-party content and copyright remain with their authors. Refer to the original license and terms.

Original license ↗

Synchronization, copying and user-reported success do not mark a resource as runtime-tested.

Limitations and notes

  • Collecting metadata does not mean this site has installed, adapted, runtime-tested or security-reviewed the resource.