# uber-go/goleak

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/uber-go-goleak).**

_How this analysis was created: the description and tags below were written by an AI model that read this project's README and public documentation pages; stars, license and language come straight from the GitHub API. The model does not read the source code._

5,219 stars · 163 forks · Go · MIT

## Links

- GitHub: https://github.com/uber-go/goleak
- awesome-repositories: https://awesome-repositories.com/repository/uber-go-goleak.md

## Description

Goleak is a diagnostic utility designed to identify and report leaked goroutines within Go applications. By integrating directly with standard testing frameworks, it validates that background tasks terminate correctly after the completion of individual test cases, packages, or entire test suites.

The tool functions by capturing snapshots of active execution threads and comparing them against a baseline to isolate newly spawned processes. To ensure accuracy and reduce noise, it provides mechanisms to filter specific stack traces, ignore known background tasks, and perform retries to account for transient operations that may conclude shortly after a test finishes.

This library supports the maintenance of stable automated test suites by pinpointing the source of concurrency bugs and preventing resource exhaustion. It is distributed as a testing framework extension that can be incorporated into existing workflows to monitor runtime behavior and verify the overall concurrency health of software.

## Tags

### Software Engineering & Architecture

- [Goroutine Leak Prevention](https://awesome-repositories.com/f/software-engineering-architecture/memory-usage-analysis/memory-leak-prevention/goroutine-leak-prevention.md) — A testing utility that identifies and reports leaked goroutines by inspecting runtime stacks after test execution to ensure clean resource management.
- [Test Suite Extensions](https://awesome-repositories.com/f/software-engineering-architecture/extensibility-frameworks/framework-extensions/test-suite-extensions.md) — Integrates with standard test suites to validate that no background tasks remain active after individual tests or packages finish.
- [Stack Trace Recoveries](https://awesome-repositories.com/f/software-engineering-architecture/stacks/stack-trace-formatters/error-stack-filtering/stack-trace-recoveries.md) — Excludes specific background tasks or functions from leak detection by matching stack traces to reduce noise and false positives. ([source](https://github.com/uber-go/goleak/blob/master/options_test.go))

### Testing & Quality Assurance

- [Concurrent Software Testing](https://awesome-repositories.com/f/testing-quality-assurance/concurrent-software-testing.md) — Identifies and prevents background goroutine leaks during automated test execution to ensure stable and resource-efficient software performance.
- [Thread Leak Detection](https://awesome-repositories.com/f/testing-quality-assurance/debugging-diagnostics/memory-leak-detection/thread-leak-detection.md) — Detects active background goroutines to identify resource leaks during test execution and report unexpected persistence. ([source](https://github.com/uber-go/goleak/blob/master/utils_test.go))
- [Automated Test Suites](https://awesome-repositories.com/f/testing-quality-assurance/automated-test-suites.md) — Integrates leak detection into existing test workflows to isolate and resolve concurrency bugs that cause flaky or unstable test results.
- [Concurrency Analysis](https://awesome-repositories.com/f/testing-quality-assurance/concurrency-analysis.md) — A diagnostic tool that filters and monitors active goroutines to isolate concurrency bugs and prevent resource exhaustion in concurrent applications.
- [Test Isolation Verifiers](https://awesome-repositories.com/f/testing-quality-assurance/debugging-diagnostics/memory-leak-detection/thread-leak-detection/test-isolation-verifiers.md) — Runs leak detection across individual test cases to pinpoint the specific source of background task leaks within a software package. ([source](https://github.com/uber-go/goleak#readme))
- [Asynchronous Polling Mechanisms](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/assertion-extensions-modes/asynchronous-interaction-utilities/asynchronous-polling-mechanisms.md) — Repeats verification checks over a configurable duration to account for transient tasks that terminate shortly after the primary execution.
- [Test Lifecycle Hooks](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/test-lifecycle-execution-control/test-lifecycle-hooks.md) — Hooks into the standard testing framework to automatically trigger validation logic immediately following the completion of individual test cases.

### Data & Databases

- [Execution Snapshots](https://awesome-repositories.com/f/data-databases/data-snapshotting/state-snapshots/execution-snapshots.md) — Records a baseline of active tasks before execution and compares it against a final state to isolate newly spawned leaks.

### Development Tools & Productivity

- [Runtime Debugging](https://awesome-repositories.com/f/development-tools-productivity/debugging-profiling-testing/debugging-diagnostics/debugging-inspection-tools/debugging-and-inspection-tools/runtime-debugging.md) — Inspects active background tasks and stack traces to diagnose unexpected process persistence and improve the overall health of concurrent applications.

### System Administration & Monitoring

- [Test State Cleanup](https://awesome-repositories.com/f/system-administration-monitoring/execution-callbacks/cleanup-callbacks/test-state-cleanup.md) — Validates that no unexpected background tasks remain running after individual tests or entire test suites finish execution to ensure a clean state. ([source](https://github.com/uber-go/goleak/blob/master/leaks.go))
- [Stack Trace Inspections](https://awesome-repositories.com/f/system-administration-monitoring/stack-trace-inspections.md) — Captures the current state of all active execution threads by querying the internal runtime to identify lingering background processes.

### Part of an Awesome List

- [Development Utilities](https://awesome-repositories.com/f/awesome-lists/devtools/development-utilities.md) — Detects goroutine leaks.
