go-middleware
CommunityIdiomatic Go HTTP middleware patterns
Authorjavierhbr
Version1.0.0
Installs0
System Documentation
What problem does it solve?
This Skill provides robust, idiomatic Go HTTP middleware patterns to handle cross-cutting concerns like context propagation, structured logging, error handling, and panic recovery, ensuring cleaner and more resilient Go web services.
Core Features & Use Cases
- Context Propagation: Manages request-scoped data (request IDs, user info) using type-safe context keys.
- Structured Logging: Integrates
slogfor consistent, searchable logs with customizable levels and sources. - Centralized Error Handling: Implements an
AppHandlerpattern for consistent error responses and uses aRecoverymiddleware to prevent panics from crashing the server. - Use Case: When building a new Go API, use this Skill's middleware to automatically add request IDs, log all incoming requests with relevant details, handle errors gracefully, and ensure the server remains stable even if a handler panics.
Quick Start
Apply the Recovery, RequestID, and Logger middleware to your HTTP router in the correct order.
Dependency Matrix
Required Modules
None requiredComponents
references
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: go-middleware Download link: https://github.com/javierhbr/random-poc/archive/main.zip#go-middleware Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.