golang-troubleshooting

Diagnose Go program failures using evidence-first debugging with Go tooling.

2|Updated Feb 12, 2024
One-click install
npx skills add https://github.com/adibfirman/dotfiles --skill golang-troubleshooting-adibfirman
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-troubleshooting
Source: https://github.com/adibfirman/dotfiles/tree/main/claude/.claude/skills/technical/golang/golang-troubleshooting
Command: npx skills add https://github.com/adibfirman/dotfiles --skill golang-troubleshooting-adibfirman

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you systematically troubleshoot failing, crashing, hanging, or unexpectedly behaving Go programs by driving you to identify the true root cause rather than applying guesswork symptom fixes.

Core Features & Use Cases

  • Evidence-first debugging workflow for moving from symptom to reproducible failure and confirmed root cause.
  • Decision-tree triage across common Go failure modes (crashes, deadlocks, races, hangs, CPU/memory issues, flaky behavior).
  • Deep diagnostic tooling guidance including pprof capture/analysis, Delve debugging, race detection, and GODEBUG tracing.
  • Use Case: When an HTTP service “sometimes” returns 500s and occasional hangs, use this Skill to reproduce, run targeted diagnostics (-race, pprof goroutine/heap, GODEBUG), and trace backward to the origin rather than patching the handler surface symptom.

Quick Start

Ask an AI coding agent to debug your Go issue by following the Golden Rules: reproduce the problem first, then use the right diagnostic tool (tests, -race, or pprof/Delve/GODEBUG) to trace backward to 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 debug a Go program that hangs or deadlocks?

Debugging a hanging Go program requires reproducing the issue and using pprof goroutine profiling or GODEBUG tracing to identify blocked goroutines. This evidence-first workflow traces the deadlock to its exact origin before attempting any fix.

What is the best way to find the root cause of a Go panic?

Finding the root cause of a Go panic requires reading the error stack trace, reproducing the failure reliably, and using Delve to step through the crashing code path. This method ensures you fix the actual origin instead of patching surface symptoms.

How do I diagnose high CPU usage or memory growth in a Go service?

Diagnosing high CPU usage or memory growth in a Go service involves capturing pprof heap and CPU profiles during the spike. You measure the specific resource allocation to trace backward to the inefficient code block before applying any optimizations.

Can I use race detection for flaky Go tests and concurrency issues?

Yes, you can use the go test -race command to detect data races and concurrency issues in Go. It is a core diagnostic tool for identifying flaky behavior by highlighting unsafe concurrent memory access during test reproduction.

When should I use Delve versus pprof for troubleshooting Go failures?

Use Delve for stepping through logic errors and panics to inspect variable state, while pprof is for diagnosing performance issues like high CPU, memory growth, and deadlocks. Choose the tool based on the specific failure mode being investigated.