error-handling-go

Implement structured Go error types, remediation interfaces, and dual-channel logging.

Updated Feb 1, 2026
One-click install
npx skills add https://github.com/jralph/.config-opencode --skill error-handling-go
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: error-handling-go
Source: https://github.com/jralph/.config-opencode/tree/main/skills/error-handling-go
Command: npx skills add https://github.com/jralph/.config-opencode --skill error-handling-go

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Go-specific error handling patterns, including structured error types, remediation hooks, and observable logging for robust Go services.

Core Features & Use Cases

  • Error Type Definitions: Define typed errors with codes, messages, and severity to standardize error handling across packages.
  • Remediation Interface: Provide actions that can remediate errors and be chained with fallbacks.
  • Dual-Channel Logger: Support for both AI-friendly and human-facing logging to aid debugging and user support.
  • Property-Based Testing: Validate error-related behavior with property-based tests to ensure resilience.

Quick Start

Run the Go implementation to define Error156, including the remediation interface and the HybridLogger, then run unit tests with go test ./... to verify behavior.

Frequently Asked Questions about error-handling-go

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement structured error handling in Go back-end services?

Structured Go error handling uses typed errors with codes, messages, and severity to standardize error processing across packages. This approach applies remediation hooks and observable logging to build robust back-end services.

How do I set up a remediation interface for Go API error handling?

A Go remediation interface provides actions that remediate errors and can be chained with fallbacks. This pattern enables standardized error types to execute recovery strategies across API boundaries.

What is the best way to log Go errors for both debugging and user support?

Dual-channel logging in Go supports both AI-friendly and human-facing logs to aid debugging and user support. This observable logging approach captures structured error data across authentication flows.

Can I validate Go error handling behavior with property-based testing?

Property-based testing validates Go error-related behavior to ensure resilience. Running tests with go test verifies that typed errors, remediation interfaces, and logging components function correctly.

Does this Go error handling approach work across authentication flows and API boundaries?

Yes, standardized Go error types apply to authentication flows and API boundaries. Typed errors with codes and severity ensure consistent processing across different service packages.

Why do I need typed errors instead of standard Go errors for back-end services?

Typed Go errors define codes, messages, and severity to standardize handling across packages, overcoming standard errors' lack of structure. This enables remediation strategies and observable dual-channel logging.