# golang-design-patterns

> Idiomatic Golang design patterns — functional options, constructor APIs, `init()` and global-state avoidance, enums, pa…

Idiomatic Golang design patterns — functional options, constructor APIs, `init()` and global-state avoidance, enums, panic vs error decisions, resource management and lifecycle, graceful shutdown, timeouts and retries, streaming and iterators, and architecture styles (clean, hexagonal, DDD, flat). Apply when choosing between architectural patterns, implementing functional options, designing constructor APIs, setting up graceful shutdown, applying resilience patterns, or asking which idiomatic Go pattern fits a specific problem. Not for wiring a DI container or comparing DI libraries (→ See `samber/cc-skills-golang@golang-dependency-injection` skill), nor for error wrapping, `errors.Is`/`As`, or logging mechanics (→ See `samber/cc-skills-golang@golang-error-handling` skill).

- Type: Skill
- Made by: samber
- Category: Developer tools
- Formats: Skills
- Version: 1.2.1
- Source: https://github.com/samber/cc-skills-golang/tree/HEAD/skills/golang-design-patterns
- Page: https://pluginboard.ai/skills/golang-design-patterns

## Works with

- ChatGPT
- Claude
- Gemini
- GitHub Copilot
- Cursor
- Claude Code
- Codex
- Antigravity
- Gemini CLI
- Replit
- OpenClaw
- OpenCode
- Hermes Agent

## Install

### ChatGPT

In ChatGPT: Download the golang-design-patterns folder and zip it, then Plugins → Skills → Create → Upload from your computer. Business and Enterprise plans.

View the folder on GitHub: https://github.com/samber/cc-skills-golang/tree/HEAD/skills/golang-design-patterns

### Claude

In Claude (web or desktop): Download the golang-design-patterns folder and zip the folder itself, then upload it in Customize → Skills.

View the folder on GitHub: https://github.com/samber/cc-skills-golang/tree/HEAD/skills/golang-design-patterns

### Gemini

In Gemini: Download the golang-design-patterns folder, then at gemini.google.com click Customize → Skills → Create → Upload and pick the folder (or a .zip of it).

View the folder on GitHub: https://github.com/samber/cc-skills-golang/tree/HEAD/skills/golang-design-patterns

### GitHub Copilot

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-design-patterns ~/.copilot/skills/golang-design-patterns
```

View the folder on GitHub: https://github.com/samber/cc-skills-golang/tree/HEAD/skills/golang-design-patterns

### Cursor

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-design-patterns ~/.cursor/skills/golang-design-patterns
```

View the folder on GitHub: https://github.com/samber/cc-skills-golang/tree/HEAD/skills/golang-design-patterns

### Claude Code

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-design-patterns ~/.claude/skills/golang-design-patterns
```

View the folder on GitHub: https://github.com/samber/cc-skills-golang/tree/HEAD/skills/golang-design-patterns

### Codex

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-design-patterns ~/.agents/skills/golang-design-patterns
```

View the folder on GitHub: https://github.com/samber/cc-skills-golang/tree/HEAD/skills/golang-design-patterns

### Antigravity

In Antigravity: Copy the golang-design-patterns folder into ~/.gemini/config/skills (Antigravity app and IDE) or ~/.gemini/antigravity-cli/skills (Antigravity CLI).

View the folder on GitHub: https://github.com/samber/cc-skills-golang/tree/HEAD/skills/golang-design-patterns

### Gemini CLI

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-design-patterns ~/.gemini/skills/golang-design-patterns
```

View the folder on GitHub: https://github.com/samber/cc-skills-golang/tree/HEAD/skills/golang-design-patterns

### Replit

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-design-patterns .agents/skills/golang-design-patterns
```

View the folder on GitHub: https://github.com/samber/cc-skills-golang/tree/HEAD/skills/golang-design-patterns

### OpenClaw

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-design-patterns ~/.openclaw/skills/golang-design-patterns
```

View the folder on GitHub: https://github.com/samber/cc-skills-golang/tree/HEAD/skills/golang-design-patterns

### OpenCode

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-design-patterns ~/.config/opencode/skills/golang-design-patterns
```

View the folder on GitHub: https://github.com/samber/cc-skills-golang/tree/HEAD/skills/golang-design-patterns

### Hermes Agent

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-design-patterns ~/.hermes/skills/golang-design-patterns
```

View the folder on GitHub: https://github.com/samber/cc-skills-golang/tree/HEAD/skills/golang-design-patterns

---
From Pluginboard (https://pluginboard.ai).
