golang-troubleshooting

Diagnose Go program failures through systematic reproduction and root-cause tracing.

1|Updated Mar 21, 2026
One-click install
npx skills add https://github.com/dashkan/pivox --skill golang-troubleshooting-dashkan
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-troubleshooting
Source: https://github.com/dashkan/pivox/tree/main/.agents/skills/golang-troubleshooting
Command: npx skills add https://github.com/dashkan/pivox --skill golang-troubleshooting-dashkan

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you systematically debug and fix Go programs by identifying the root cause behind bugs, panics, deadlocks, and unexpected behavior instead of applying risky symptom-only patches.

Core Features & Use Cases

  • Decision-tree driven troubleshooting: Classify issues (compile errors, logic bugs, panics, hangs, high CPU, memory growth, latency spikes) and jump to the right diagnostic path.
  • Golden Rules for reliable fixes: Read the full error, reproduce before changing code, test one hypothesis at a time, and avoid workarounds that mask the real issue.
  • Evidence-based tooling guidance: Use pprof (goroutine/heap/profile/mutex/block), Delve (breakpoints/inspection), race detection (-race), and GODEBUG/GOTRACEBACK for production-grade investigations.
  • Debugging workflow that scales from local to prod: Start simple, instrument only when needed, and escalate diagnostics incrementally to validate root cause and prevent regressions.
  • Code-review red-flag awareness: Leans on common Go failure modes (nil pointers, typed-nil interfaces, deferred-in-loop leaks, context misuse, races, sync misuse, unchecked errors).
  • Root-cause tracing: Emphasizes walking backward from the symptom to where invalid data is introduced, often enabling proper fixes at constructors/entry points.

Quick Start

Tell me what symptom you see in your Go program (error text, panic stack trace, whether it hangs or races), then I will help you reproduce it and pick the smallest diagnostic step (logs/tests first, then pprof/Delve/race/GODEBUG) to locate the root cause before proposing any fix.

Frequently Asked Questions about golang-troubleshooting

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

FAQPage Schema
How do I find the root cause of a Go panic or crash?

To debug a Go deadlock, start with goroutine stack traces using GOTRACEBACK=all, then escalate to pprof goroutine profiling to identify blocked goroutines and sync misuse. Reproduce the hang locally before adjusting mutex or channel synchronization.

What is the best way to debug high CPU usage or memory growth in a Go program?

The best way to debug high CPU or memory growth in Go is incremental escalation: start with runtime logs, then use pprof heap and profile captures to locate allocation hotspots or CPU-intensive functions before applying source-level fixes.

How do I detect and fix data races in my Go application?

Detect data races in Go by running tests and builds with the -race flag. When the race detector reports concurrent access, trace the conflicting goroutines back to their entry points to fix the synchronization issue rather than masking the symptom.

Can I use this systematic debugging workflow for production Go incidents?

Yes, this workflow scales to production Go incident debugging by guiding evidence gathering from available stack traces and outputs, then recommending minimal diagnostic instrumentation like GODEBUG settings and pprof to safely locate the root cause.

Why does my Go program still leak memory even after fixing obvious nil pointer issues?

Memory leaks in Go often stem from deferred calls inside loops, typed-nil interfaces, or context misuse. Trace allocations backward from the symptom using pprof heap profiling to identify where references are improperly retained instead of applying symptom patches.