golang-troubleshooting

Diagnose Go bugs, crashes, deadlocks, and flaky tests with root-cause tracing.

2|Updated Mar 13, 2023
One-click install
npx skills add https://github.com/haipham22/golang-sample --skill golang-troubleshooting-haipham22
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: golang-troubleshooting
Source: https://github.com/haipham22/golang-sample/tree/main/.agents/skills/golang-troubleshooting
Command: npx skills add https://github.com/haipham22/golang-sample --skill golang-troubleshooting-haipham22

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you diagnose and fix Go bugs, crashes, deadlocks, flaky tests, build failures, and unexpected runtime behavior by tracing the real cause instead of patching symptoms.

Core Features & Use Cases

  • Systematic Debugging: Follows a strict evidence-first workflow that starts with reproduction, then narrows the scope, tests one hypothesis at a time, and verifies the fix.
  • Go-Specific Bug Hunting: Covers common pitfalls such as nil pointer issues, interface nil gotchas, variable shadowing, defer mistakes, channel and select bugs, race conditions, and resource leaks.
  • Diagnostic Tooling: Uses tests, race detection, pprof, Delve, GODEBUG tracing, and production-safe debugging techniques to investigate hangs, high CPU, memory growth, and latency spikes.
  • Use Case: If a Go service intermittently fails in production, this Skill guides you to reproduce the issue, collect evidence, inspect profiles or stack traces, and fix the root cause with confidence.

Quick Start

Use the golang-troubleshooting skill to investigate this Go bug by reproducing it first, tracing the root cause, and proposing a verified 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 intermittent Go deadlocks and crashes in production?

To debug intermittent Go deadlocks and crashes in production, use pprof profiling, GODEBUG tracing, and Delve to collect evidence, inspect stack traces, and trace the root cause before verifying a fix.

What is the best way to find race conditions causing flaky tests in Golang?

The best way to find race conditions causing flaky tests in Golang is to use the race detector alongside an evidence-first workflow, narrowing scope and testing one hypothesis at a time to isolate the concurrency failure.

How do I trace the root cause of high CPU usage or memory leaks in a Go service?

To trace the root cause of high CPU usage or memory leaks in a Go service, use pprof profiling and GODEBUG tracing to inspect resource consumption, identify the exact bottleneck, and verify the regression fix.

Why does my Go code fail with nil pointer and interface nil gotchas?

Your Go code fails with nil pointer and interface nil gotchas due to common concurrency and typing pitfalls; diagnose the exact runtime behavior using Delve debugging to inspect variables and trace the root cause systematically.

Can I use Delve to investigate unexpected runtime behavior and channel bugs?

Yes, you can use Delve to investigate unexpected runtime behavior and channel bugs by stepping through code, inspecting select statement execution, and verifying hypotheses against failing tests to resolve the root cause.

How do I verify a fix for a Golang build failure or unexpected runtime behavior?

To verify a fix for a Golang build failure or unexpected runtime behavior, you must reproduce the original issue, implement the fix, and confirm the resolution through regression verification using failing tests and systematic debugging.