golang-samber-oops

Add context, stack traces, and error codes to Golang errors.

Updated May 30, 2026
One-click install
npx skills add https://github.com/ozan-fn/mqtt-capture --skill golang-samber-oops-ozan-fn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-samber-oops
Source: https://github.com/ozan-fn/mqtt-capture/tree/main/.agents/skills/golang-samber-oops
Command: npx skills add https://github.com/ozan-fn/mqtt-capture --skill golang-samber-oops-ozan-fn

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires github.com/samber/oops, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill provides a comprehensive approach to structured error handling in Golang, enhancing the ability to diagnose and manage errors effectively.

Core Features & Use Cases

  • Structured Error Handling: Adds context, stack traces, error codes, public messages, and panic recovery.
  • Fluent Builder Pattern: Enables chaining methods for error creation, making error handling concise and readable.
  • Error Propagation: Ensures errors carry context through the call stack, aiding in debugging and troubleshooting.
  • Use Case: Utilize this Skill when developing Golang applications that require robust error handling and structured error information.

Quick Start

Apply the golang-samber-oops skill to your project for better error management in your Go applications.

Frequently Asked Questions about golang-samber-oops

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

FAQPage Schema
How do I add structured context and stack traces to Golang error handling?

Structured context and stack traces are added to Golang error handling through a fluent builder pattern that chains methods, attaching error codes and diagnostic data to errors as they propagate through the call stack.

What is the best way to propagate errors with context in a Go application?

The best way to propagate errors with context in a Go application is by wrapping errors with structured information as they travel up the call stack, preserving the original failure reason and surrounding diagnostic context for troubleshooting.

How does panic recovery work with structured error information in Golang?

Panic recovery with structured error information in Golang captures runtime panics and converts them into structured errors containing stack traces and context, allowing applications to handle unexpected failures gracefully without crashing.

Do I need the samber/oops library to use structured error context in my Go project?

Yes, the samber/oops library is required to implement this structured error context approach, as the Skill enhances Golang applications by relying on this dependency for its fluent builder pattern and error propagation features.

Can I use this structured error handling approach for AI coding agents in Golang?

Yes, this structured error handling approach can be used for AI coding agents in Golang, as the implementation is specifically designed to provide robust error management and structured diagnostic information within AI coding agent projects.

Why are my Golang errors missing context when passed through multiple functions?

Golang errors miss context when passed through multiple functions if returned unwrapped, a problem solved by using structured error propagation methods that attach context, error codes, and stack traces to the error object during the call stack chain.