golang-troubleshooting

Diagnose and fix root causes of bugs, crashes, and deadlocks in Go programs.

Updated Jun 8, 2026
One-click install
npx skills add https://github.com/vovanostm-public/multica --skill golang-troubleshooting-vovanostm-public
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: golang-troubleshooting
Source: https://github.com/vovanostm-public/multica/tree/main/docs/wiki/architecture/archived-codex-skills/20260525-190000/golang-troubleshooting
Command: npx skills add https://github.com/vovanostm-public/multica --skill golang-troubleshooting-vovanostm-public

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Go programs fail in subtle ways — nil pointer panics, race conditions, goroutine leaks, and silent error swallowing — and guessing at fixes wastes time and creates new bugs. This Skill enforces a systematic debugging methodology that finds the actual root cause before any fix is applied. ## Core Features & Use Cases - Systematic Debugging Methodology: A 10-step process covering symptom definition, reproduction with failing tests, single-hypothesis testing, root-cause tracing, and defense-in-depth fixes. - Common Go Bug Catalog: Documented patterns with reproductions and fixes for nil dereferences, interface nil gotchas, variable shadowing, defer-in-loop leaks, concurrent map access, JSON pitfalls, and more. - Diagnostic Tooling Guidance: Practical references for pprof profiling, Delve debugger, race detector, GODEBUG tracing, and production debugging with proper security controls. - Use Case: When a Go service intermittently crashes in production, use this Skill to capture goroutine dumps, run the race detector, trace the data flow back to the source, and fix the bug at its origin rather than patching the symptom. ## Quick Start Use the golang-troubleshooting skill to debug why my Go HTTP server panics with a nil pointer dereference under load.

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 panics intermittently?▼

Run the program with GOTRACEBACK=all to capture full stack traces, then execute go test -race ./... to detect data races. Write a failing test that reproduces the panic before attempting any fix, and trace the data flow back to where the invalid value originated.

How do I find goroutine leaks in a Go application?▼

Capture a goroutine profile with curl localhost:6060/debug/pprof/goroutine?debug=2 and look for goroutines stuck in chan receive. In tests, use the goleak package to automatically detect leaked goroutines after each test run.

Why does my Go error check fail even when no error occurred?▼

This is the interface nil gotcha: returning a typed nil pointer as an error interface produces a non-nil interface. The fix is to return nil explicitly instead of returning the typed nil variable.

Can recover() catch panics from child goroutines in Go?▼

No, recover() only works in the same goroutine where it is deferred. A panic in a child goroutine crashes the entire process, so each goroutine must include its own defer/recover block.

Is it safe to expose pprof endpoints in production Go services?▼

No, pprof endpoints must be protected with authentication and never exposed publicly, since they leak goroutine stacks and memory contents. Run pprof on a separate port or localhost, gate it behind an environment variable, and require basic auth.

When should I use Delve instead of pprof for Go debugging?▼

Use Delve when you need breakpoint-based stepping through code, inspecting local variables, and switching between goroutines interactively. Use pprof for profiling CPU, heap, mutex, and goroutine behavior in running or production services.