golang-error-handling
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 ma
Asset-Profil
Coding- und Entwickler-Agents
Code review, repo analysis, testing, CI, GitHub, DevOps, and developer workflow skills.
Szenario
Coding-Agents
I need a coding agent that can understand a repository, edit code, and review pull requests.
Agent-Fit
Claude Code + OpenAI Agents + CLI
Geeignet für Codex, Claude Code, Cursor, CLI oder benutzerdefinierte Agents.
Installieren
Bereit
npx skills add samber/cc-skills-golang --skill golang-error-handling
Wartung
Aktuell
2 Tage seit dem letzten Push
Risiko
Sicher zu testen
Quality score needs review
GitHub-Qualität
3.0K
82/100 Qualität · 81/100 Vertrauen
Abdeckungs-Tags
Review-Notizen
Quality score needs review
Agent-Adoptionskarte
Vertrauen, Audit und Installationsbereitschaft auf einen Blick
Diese Werte kombinieren öffentliche Repository-Metadaten, OpenAgentSkill-Reviewsignale, Wartungsaktualität und Installationsbereitschaft. Sie helfen bei der Vorauswahl, ersetzen aber keine menschliche Prüfung.
Qualität
StarkSolid option that is likely worth shortlisting for production workflows.
Vertrauen
Nur SandboxNützlicher Kandidat mit fehlenden oder gemischten Vertrauenssignalen. Bis der Ergebniszyklus die Passung belegt, in einem isolierten Arbeitsbereich verwenden.
Audit
Sicher zu testenMaschinenlesbare Prüfung von Installationsbereitschaft, Sicherheitsmetadaten, Wartung und Akzeptanzrisiko.
OpenAgentSkill Trust Score v5
Menschliche Prüfung vor Installation
Nur in einer Sandbox ausführen und nahe Alternativen vergleichen, bevor sie produktiv eingesetzt wird.
Stars
3.0K GitHub-Stars
Repository-Aktivität
3.0K Stars und 197 Forks
Wartung
2 Tage seit dem letzten Push
Lizenz
MIT
Installieren
npx skills add samber/cc-skills-golang --skill golang-error-handling
Installationssicherheit
Standard-Paket- oder Laufzeit-Installationspfad
Berechtigungsfläche
shell or command execution, network or browser access
Agent-Ergebnisse
Noch keine Agent-Ergebnisdaten
Dokumentation
Starker README/SKILL.md-Kontext
Risikoübersicht
Vor Produktion prüfen
- Quality score needs review
Installationsbereitschaft
Installationspfad verfügbar
- Installationspfad ist verfügbar
- Repository-Belege sind verfügbar
- Lizenz ist angegeben
- Noch keine Agent-Proven-Ergebnisbelege
Agent-lesbare Metadaten
Maschinenlesbare Entscheidungsdaten für diesen Skill.
Nutze diesen Block oder das eingebettete JSON, um zu entscheiden, ob ein Agent diesen Skill installieren, eine Alternative wählen oder zuerst menschliche Prüfung anfordern soll.
Geeignete Aufgaben
- Coding-Agents-Workflows
- Claude-Code-Teams
- Teams, die GitHub-Adoptionssignale schätzen
- Inspect source files
Geeignete Agents
Installationsentscheidung
- Befehl
- npx skills add samber/cc-skills-golang --skill golang-error-handling
- Richtlinie
- Prüfen
- Menschliche Prüfung
- Ja
Vertrauen und Risiko
- Vertrauen
- 73/100
- Audit
- 85/100
- Risikoebene
- Sicher zu testen
Ergebnis-Loop
- Endpoint
- /api/agent/outcome
- Event-ID
- resolve
- Ergebnisse
- 5
Installationsbefehl
npx skills add samber/cc-skills-golang --skill golang-error-handlingNicht verwenden, wenn
- Teams, die ein vom Anbieter unterstütztes SLA benötigen
- Hochregulierte Umgebungen ohne interne Sicherheitsprüfung
- No major risk signals from current metadata
- Hinweise auf Hochrisiko-Berechtigungen: Shell- oder Befehlsausführung
- Quality score needs review
Alternative
Last30days Skill
53.5K Stars
npx skills add mvanhorn/last30days-skill -g
Alternative
Academic Research Skills
38.4K Stars
npx skills add Imbad0202/academic-research-skills
Alternative
GPT Researcher
28.0K Stars
npx skills add assafelovic/gpt-researcher
Alternative
DeepResearch
19.8K Stars
npx skills add Alibaba-NLP/DeepResearch
Agent-Sicherheit v2
61/100 · Vor Installation prüfen
Nutzbarer Kandidat, aber der Agent sollte Berechtigungs- und Auditnotizen vor der Installation anzeigen.
Vor der Installation in einem echten Arbeitsbereich ist menschliche Freigabe erforderlich.
Hoch
Shell- oder Befehlsausführung
Die Skill-Metadaten verweisen auf Terminal-, CLI-, Shell-, Subprozess- oder Befehlsausführungs-Workflows.
Mittel
Netzwerkzugriff
Die Skill ruft wahrscheinlich Remote-Seiten, APIs, Repositories oder externe Dienste ab.
- Hinweise auf Hochrisiko-Berechtigungen: Shell- oder Befehlsausführung
- Quality score needs review
Installationsziele
Diesen Skill im Agent-Workflow installieren
Über den öffentlichen Endpunkt erhältst du Befehl, Sicherheitscheckliste, Ziel-Prompts und kanonische Links.
OpenAgentSkill CLI
Resolve policy, run the source installer safely, and report a verified install receipt.
$ npx --yes https://github.com/Leon-Drq/openagentskill/releases/download/cli-v0.2.1/openagentskill-0.2.1.tgz install samber-golang-error-handlingAgent-Auflösungsplan
Lass einen Agent die Eignung vor der Installation prüfen.
Die Resolve API liefert die beste Skill, Alternativen, Sicherheitsrichtlinien, Auditnotizen, Installationsziel und einen direkt nutzbaren Prompt.
JSON öffnen
/api/agent/resolve?task=Use%20golang-error-handling%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Resolve-Text
/api/agent/resolve?task=Use%20golang-error-handling%20for%20an%20agent%20workflow&agent=codex&max_risk=medium&format=text
Installationsübergabe
/api/skills/samber-golang-error-handling/install
Agent sollte prüfen
- Task fit and alternatives from Resolve API.
- Audit score, trust score, and safety policy warnings.
- Install target compatibility for Codex, Claude Code, Cursor, or CLI.
Prompt kopieren
Task: Use golang-error-handling in this workspace.
Resolve first: https://www.openagentskill.com/api/agent/resolve?task=Use%20golang-error-handling%20for%20an%20agent%20workflow&agent=codex&max_risk=medium
Review install handoff: https://www.openagentskill.com/api/skills/samber-golang-error-handling/install
Install command: npx skills add samber/cc-skills-golang --skill golang-error-handling
Before running it, summarize audit warnings, required permissions, and the fallback skill if install is risky.Agent-Übergabe
Gib dem Agent den Installationspfad, nicht noch ein Verzeichnis.
Über den öffentlichen Endpunkt erhältst du Befehl, Sicherheitscheckliste, Ziel-Prompts und kanonische Links.
Installationsübergabe
/api/skills/samber-golang-error-handling/install
LLM-Textformat
/api/skills/samber-golang-error-handling/install?format=text
Alternativen finden
/api/skills/search?q=golang-error-handling&limit=3
Agent-Prompt
Use golang-error-handling for this task. Review https://www.openagentskill.com/api/skills/samber-golang-error-handling/install, then install with: npx skills add samber/cc-skills-golang --skill golang-error-handlingRegistry-Metadaten
Agent-lesbares Profil für die automatische Skill-Auswahl.
Die Registry API stellt Entscheidungs-, Vertrauens-, Audit-, Use-Case- und Installationssignale ohne UI-Scraping bereit.
Manifest
/api/registry/manifest/samber-golang-error-handling
LLM-Text
/api/registry/manifest/samber-golang-error-handling?format=text
Installationsalias
/api/registry/install/samber-golang-error-handling
Empfehlen
/api/registry/recommend?task=Use%20golang-error-handling%20in%20an%20agent%20workflow&limit=3
Agent-Fit
Coding-Agents
Use-Case-Tags
Plattformen
Claude Code, OpenAI Agents
Audit-Bericht
Sicher zu testen · 85/100
Maschinenlesbare Prüfung von Installationsbereitschaft, Sicherheitsmetadaten, Wartung und Akzeptanzrisiko.
Agent-Entscheidungspanel
Primäre Wahl für Coding-Agents
Use this as a leading candidate, then validate the README and install path in your own agent stack.
Rolle im Stack
Primäre Wahl
Primäre Eignung
Coding-Agents
Vertrauenslabel
Produktionsbereit
Installationspfad
Befehl bereit
Verwenden wenn
- Coding-Agents-Workflows
- Claude-Code-Teams
- Teams, die GitHub-Adoptionssignale schätzen
Evidenz
- 3,022 GitHub-Stars
- recent repository activity
- install command or GitHub repo available
- Qualitätsprofil 82/100
- 6 OpenAgentSkill-Interaktionen
zuerst prüfen
- No major risk signals from current metadata
Implementierungspfad
- 1Installieren Sie es in einem Sandbox-Agent und führen Sie eine Coding-Agents-Aufgabe vollständig aus.
- 2Compare output quality, latency, and failure behavior against at least one alternative.
- 3Promote it into production only after reviewing repository permissions, license, and maintenance signals.
Vertrauensprofil
Nur Sandbox
Nützlicher Kandidat mit fehlenden oder gemischten Vertrauenssignalen. Bis der Ergebniszyklus die Passung belegt, in einem isolierten Arbeitsbereich verwenden.
GitHub-Akzeptanz
Bestanden3.0K GitHub-Stars
Star-/Fork-Aktivität
Info3.0K Stars und 197 Forks; Issue-Aktivität ist in den aktuellen Metadaten nicht verfügbar
Aktuelle Wartung
Bestanden2 Tage seit dem letzten Push
Lizenzklarheit
BestandenMIT
Positive Signale
- KI-Prüfung genehmigt
- Installationspfad ist verfügbar
- Repository-Belege sind verfügbar
- Kürzlich gewartetes Repository
- Aussagekräftiges GitHub-Adoptionssignal
- Der Installationsbefehl weist kein offensichtliches Hochrisikomuster auf
- Ergebniszyklus ist bereit, benötigt aber den ersten echten Agent-Lauf
Vor Installation prüfen
- Quality score needs review
- Noch keine echten Agent-Ergebnisberichte
- Vor unbeaufsichtigter Installation ist menschliche Prüfung erforderlich
Empfohlene Aktion
Nur in einer Sandbox ausführen und nahe Alternativen vergleichen, bevor sie produktiv eingesetzt wird.
Qualitätsprofil
Stark Kandidat für Agent-Workflows
Solid option that is likely worth shortlisting for production workflows.
Workflow-Eignung
Diese Skill in diesen Szenarien nutzen
Build and ship code
Coding agents
I need a coding agent that can understand a repository, edit code, and review pull requests.
Manage repositories
GitHub automation
I need my agent to triage GitHub issues, review pull requests, and summarize repository changes.
Investigate faster
Research agents
I need my agent to research a topic, compare sources, and produce a concise report.
Workflow-Eignung
Zum vollständigen Workflow hinzufügen
Inspect, patch, and verify code
Coding review agent
A workflow for software agents that inspect repositories, review pull requests, generate tests, and turn findings into shippable patches.
Find, compare, and synthesize
Research report agent
A workflow for agents that gather sources, compare claims, summarize long material, and draft useful research briefs.
Operate and verify web apps
Browser QA agent
A workflow for agents that navigate products, fill forms, take screenshots, and verify real user flows across web applications.
Alternativen-Shortlist
Vor Installation vergleichen
Similar skills that may fit this task.
Last30days Skill
Research the last 30 days across Reddit, X, YouTube, Hacker News, Polymarket, GitHub, and the web, then synthesize a grounded brief for an AI agent.
Academic Research Skills
Academic Research Skills for Claude Code: research → write → review → revise → finalize
GPT Researcher
Run autonomous deep research over web and local sources
DeepResearch
Tongyi Deep Research, the Leading Open-source Deep Research Agent
Übersicht
--- name: golang-error-handling description: "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." user-invocable: true license: MIT compatibility: Designed for Claude Code, Codex or similar harness, and for projects using Golang. metadata: author: samber version: "1.3.0" openclaw: emoji: "⚠" homepage: https://github.com/samber/cc-skills-golang requires: bins: - go install: [] allowed-tools: Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent paths: - "**/*.go" ---
**Persona:** You are a Go reliability engineer. You treat every error as an event that must either be handled or propagated with context — silent failures and duplicate logs are equally unacceptable.
**Orchestration mode:** Fan out the five category sub-agents described in the "Parallelizing Error Handling Audits" section (creation, wrapping, single-handling rule, panic/recover, structured logging) for auditing error handling across a large codebase, and consolidate their findings. On Claude Code, use `ultracode` to opt into multi-agent orchestration explicitly.
**Modes:**
- **Coding mode** — writing new error handling code. Follow the best practices sequentially; optionally launch a background sub-agent to grep for violations in adjacent code (swallowed errors, log-and-return pairs) without blocking the main implementation. - **Review mode** — reviewing a PR's error handling changes. Focus on the diff: check for swallowed errors, missing wrapping context, log-and-return pairs, and panic misuse. Sequential. - **Audit mode** — auditing existing error handling across a codebase. Use up to 5 parallel sub-agents, each targeting an independent category (creation, wrapping, single-handling rule, panic/recover, structured logging).
> **Community default.** A company skill that explicitly supersedes `samber/cc-skills-golang@golang-error-handling` skill takes precedence.
# Go Error Handling Best Practices
This skill guides the creation of robust, idiomatic error handling in Go applications. Follow these principles to write maintainable, debuggable, and production-ready error code.
## Best Practices Summary
1. **Returned errors MUST always be checked** — NEVER discard with `_` 2. **Errors MUST be wrapped with context** using `fmt.Errorf("{context}: %w", err)` 3. **Error strings MUST be lowercase**, without trailing punctuation 4. **Use `%w` internally, `%v` at system boundaries** to control error chain exposure 5. **MUST use `errors.Is` for sentinel matching and `errors.As`/`errors.AsType` for typed chain inspection** instead of direct comparison or bare type assertions. For Go 1.26+, prefer `errors.AsType[T](err)` when `T` implements `error`; use `errors.As(err, &target)` for Go <1.26 or for non-error interface targets. 6. **SHOULD use `errors.Join`** (Go 1.20+) to combine independent errors 7. **Errors MUST be either logged OR returned**, NEVER both (single handling rule) 8. **Use sentinel errors** for expected conditions, custom types for carrying data 9. **NEVER use `panic` for expected error conditions** — reserve for truly unrecoverable states 10. **SHOULD use `slog`** (Go 1.21+) for structured error logging — not `fmt.Println` or `log.Printf` 11. **Use `samber/oops`** for production errors needing stack traces, user/tenant context, or structured attributes 12. **Log HTTP requests** with structured middleware capturing method, path, status, and duration 13. **Use log levels** to indicate error severity 14. **Never expose technical errors to users** — translate internal errors to user-friendly messages, log technical details separately 15. **Keep log grouping low-cardinality** — at logging/APM boundaries, keep message templates stable and attach IDs, paths, line numbers, and counts as structured attributes. Error values may include useful operational context, but avoid putting high-cardinality data into the stable log message used for grouping.
## Detailed Reference
- **[Error Creation](./references/error-creation.md)** — How to create errors that tell the story: error messages should be lowercase, no punctuation, and describe what happened without prescribing action. Covers sentinel errors (one-time preallocation for performance), custom error types (for carrying rich context), and the decision table for which to use when.
- **[Error Wrapping and Inspection](./references/error-wrapping.md)** — Why `fmt.Errorf("{context}: %w", err)` beats `fmt.Errorf("{context}: %v", err)` (chains vs concatenation). How to inspect chains with `errors.Is`, `errors.As`, and Go 1.26+ `errors.AsType` for type-safe error handling, and `errors.Join` for combining independent errors.
- **[Error Handling Patterns and Logging](./references/error-handling.md)** — The single handling rule: errors are either logged OR returned, NEVER both (prevents duplicate logs cluttering aggregators). Panic/recover design, `samber/oops` for production errors, and `slog` structured logging integration for APM tools.
## Parallelizing Error Handling Audits
When auditing error handling across a large codebase, use up to 5 parallel sub-agents — each targets an independent error category:
- Sub-agent 1: Error creation — validate `errors.New`/`fmt.Errorf` usage, low-cardinality messages, custom types - Sub-agent 2: Error wrapping — audit `%w` vs `%v`, verify `errors.Is`/`errors.As` patterns - Sub-agent 3: Single handling rule — find log-and-return violations, swallowed errors, discarded errors (`_`) - Sub-agent 4: Panic/recover — audit `panic` usage, verify recovery at goroutine boundaries - Sub-agent 5: Structured logging — verify `slog` usage at error sites, check for PII in error messages
## Cross-References
- → See `samber/cc-skills-golang@golang-samber-oops` for full samber/oops API, builder patterns, and logger integration - → See `samber/cc-skills-golang@golang-observability` for structured logging setup, log levels, and request logging middleware - → See `samber/cc-skills-golang@golang-safety` for nil interface trap and nil error comparison pitfalls - → See `samber/cc-skills-golang@golang-naming` for error naming conventions (ErrNotFound, PathError) - → See `samber/cc-skills-golang@golang-continuous-integration` skill for automated AI-driven code review in CI using these guidelines
## References
- [lmittmann/tint](https://github.com/lmittmann/tint) - [samber/oops](https://github.com/samber/oops) - [samber/slog-multi](https://github.com/samber/slog-multi) - [samber/slog-sampling](https://github.com/samber/slog-sampling) - [samber/slog-formatter](https://github.com/samber/slog-formatter) - [samber/slog-http](https://github.com/samber/slog-http) - [samber/slog-sentry](https://github.com/samber/slog-sentry) - [log/slog package](https://pkg.go.dev/log/slog)
Technische Details
- Version
- 1.0.0
- Lizenz
- MIT
- Letzte Aktualisierung
- 21. Aug. 2026
- Veröffentlicht
- 21. Aug. 2026
Entscheidungsübersicht
Primäre Wahl
3,022 GitHub-Stars
Audit
Installationsprüfung
Installations- und Adoptionsprüfung
- Sicherheit
- 83/100
- Wartung
- 100/100
- Installieren
- 92/100
Von Agent belegte Evidenz
Von Agent belegte Evidenz
Ergebnisberichte nach Resolve, Prüfung, Installation und einem begrenzten Lauf.
- Erfolgsrate
- —
- Letzter Fehler
- —
- Ergebnisse
- 0
- Ausgabequalität
- —
- Fehlgeschlagen
- 0
- Nicht relevant
- 0
- Installationen
- 0
- Durch Risiko blockiert
- 0
- Einrichtung erforderlich
- 0
- Produktion
- 0
Noch keine Agent-Ergebnisdaten. Der erste Lauf kann Erfolg, Einrichtungsbedarf, Risikoblockaden, Fehler oder Irrelevanz über /api/agent/outcome melden.
Installieren
Zum Agent-Workflow hinzufügen
Kostenlos und Open Source. Bericht vor der Installation in Produktions-Agents prüfen.
Wachstums-Loop
Share-Kit
Szenariobasierter Entwurf für golang-error-handling, bereit für einen manuellen X-Post.
golang-error-handling: Idiomatic Golang error handling — creation, wrapping with %w, errors.Is/As, errors.Join, cust... 3.0K stars https://www.openagentskill.com/skills/samber-golang-error-handling?ref=x
Optionale Antwort mit Installationsbefehl
Listing + install path for golang-error-handling: https://www.openagentskill.com/skills/samber-golang-error-handling?ref=x Install: npx skills add samber/cc-skills-golang --skill golang-error-handling
Quelle des Eintrags
Registry-indexiert
Dieser Eintrag wurde aus öffentlichen Quellen indexiert und ist erst nach Genehmigung eines Maintainer-Anspruchs offiziell.
- Ersteller
- samber
- Quelle
- samber/cc-skills-golang
- Indexiert von
- OpenAgentSkill Community-Index
Die Zuordnung verlinkt auf das öffentliche Repository oder Creator-Profil. Creator können den Eintrag beanspruchen, um Eigentümersignale zu aktualisieren.
Diesen Skill beanspruchenEigentümeranspruch
Diesen Skill-Eintrag beanspruchen
Dieser Registry-indexiert-Eintrag wird samber zugeschrieben, ist aber noch nicht offiziell markiert. Beanspruche ihn, um ein verifiziertes Eigentümersignal hinzuzufügen und künftige Launch-, Installations- und Audit-Updates vertrauenswürdiger zu machen.
Creator-Backlink-Kit
Evidenz-Badges in deine README einfügen
Zeige den kanonischen Eintrag, aktuelle Vertrauens- und Audit-Signale sowie echte Agent-Proven-Evidenz dort, wo Entwickler das Repository bewerten.
[](https://www.openagentskill.com/skills/samber-golang-error-handling)
[](https://www.openagentskill.com/skills/samber-golang-error-handling)
[](https://www.openagentskill.com/skills/samber-golang-error-handling/audit)
[](https://www.openagentskill.com/skills/samber-golang-error-handling)Autor
samber
@samber
Tags
Plattform-Fit
Gesundheitssignale
- GitHub-Stars
- 3.0K
- Qualitätswert
- 48/100
- Letzter GitHub-Push
- 21. Aug. 2026
- Framework-Hinweise
- Unbekannt
- OpenAgentSkill-Aufrufe
- 6
- Installationskopien
- 0
- Externe Klicks
- 0
Community-Signal
Teile mit, ob dieser Skill für deinen Agent-Workflow nützlich ist. Zusammengefasstes Feedback verbessert das Ranking im Laufe der Zeit.
Vertrauen & Sicherheit
Nur Sandbox
- GitHub-Akzeptanz3.0K GitHub-StarsBestanden
- Star-/Fork-Aktivität3.0K Stars und 197 Forks; Issue-Aktivität ist in den aktuellen Metadaten nicht verfügbarInfo
- Aktuelle Wartung2 Tage seit dem letzten PushBestanden
- LizenzklarheitMITBestanden
- README/SKILL.md-VollständigkeitMetadaten enthalten ausreichend Nutzungs- und Workflow-KontextBestanden
- Abhängigkeits-/Laufzeitrisikocommand execution surface, network or browser surfaceInfo
Ähnliche Skills
Last30days Skill
Research the last 30 days across Reddit, X, YouTube, Hacker News, Polymarket, GitHub, and the web, then synthesize a grounded brief for an AI agent.
53.5K StarsAcademic Research Skills
Academic Research Skills for Claude Code: research → write → review → revise → finalize
38.4K StarsGPT Researcher
Run autonomous deep research over web and local sources
28.0K StarsDeepResearch
Tongyi Deep Research, the Leading Open-source Deep Research Agent
19.8K Stars