# golang-error-handling

> Idiomatic Golang error handling — creation, wrapping with %w, errors.Is/As, errors.Join, custom error types, sentinel e…

Idiomatic Golang error handling — creation, wrapping with %w, errors.Is/As, errors.Join, custom error types, sentinel errors, panic/recover, the single handling rule, structured logging with slog, HTTP request logging middleware, and samber/oops for production errors. Built to make logs usable at scale with log aggregation 3rd-party tools. Apply when creating, wrapping, inspecting, or logging errors in Go code. For samber/oops specifics → See `samber/cc-skills-golang@golang-samber-oops` skill; for slog handler ecosystem → See `samber/cc-skills-golang@golang-samber-slog` skill.

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

## 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-error-handling 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-error-handling

### Claude

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

### Gemini

In Gemini: Download the golang-error-handling 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-error-handling

### GitHub Copilot

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-error-handling ~/.copilot/skills/golang-error-handling
```

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

### Cursor

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-error-handling ~/.cursor/skills/golang-error-handling
```

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

### Claude Code

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-error-handling ~/.claude/skills/golang-error-handling
```

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

### Codex

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-error-handling ~/.agents/skills/golang-error-handling
```

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

### Antigravity

In Antigravity: Copy the golang-error-handling 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-error-handling

### Gemini CLI

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-error-handling ~/.gemini/skills/golang-error-handling
```

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

### Replit

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-error-handling .agents/skills/golang-error-handling
```

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

### OpenClaw

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-error-handling ~/.openclaw/skills/golang-error-handling
```

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

### OpenCode

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-error-handling ~/.config/opencode/skills/golang-error-handling
```

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

### Hermes Agent

Run in your terminal:

```shell
npx -y degit samber/cc-skills-golang/skills/golang-error-handling ~/.hermes/skills/golang-error-handling
```

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

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