# golang-structs-interfaces

> Golang struct and interface design patterns — composition, embedding, type assertions, type switches, interface segrega…

Golang struct and interface design patterns — composition, embedding, type assertions, type switches, interface segregation, dependency injection via interfaces, struct field tags, and pointer vs value receivers. Use this skill when designing Go types, defining or implementing interfaces, embedding structs or interfaces, writing type assertions or type switches, adding struct field tags for JSON/YAML/DB serialization, or choosing between pointer and value receivers. Also use when the user asks about "accept interfaces, return structs", compile-time interface checks, or composing small interfaces into larger ones.

- 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-structs-interfaces
- Page: https://pluginboard.ai/skills/golang-structs-interfaces

## 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-structs-interfaces 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-structs-interfaces

### Claude

In Claude (web or desktop): Download the golang-structs-interfaces 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-structs-interfaces

### Gemini

In Gemini: Download the golang-structs-interfaces 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-structs-interfaces

### GitHub Copilot

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-structs-interfaces ~/.copilot/skills/golang-structs-interfaces
```

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

### Cursor

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-structs-interfaces ~/.cursor/skills/golang-structs-interfaces
```

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

### Claude Code

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-structs-interfaces ~/.claude/skills/golang-structs-interfaces
```

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

### Codex

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-structs-interfaces ~/.agents/skills/golang-structs-interfaces
```

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

### Antigravity

In Antigravity: Copy the golang-structs-interfaces 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-structs-interfaces

### Gemini CLI

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-structs-interfaces ~/.gemini/skills/golang-structs-interfaces
```

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

### Replit

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-structs-interfaces .agents/skills/golang-structs-interfaces
```

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

### OpenClaw

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-structs-interfaces ~/.openclaw/skills/golang-structs-interfaces
```

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

### OpenCode

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-structs-interfaces ~/.config/opencode/skills/golang-structs-interfaces
```

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

### Hermes Agent

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-structs-interfaces ~/.hermes/skills/golang-structs-interfaces
```

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

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