# uber-go/nilaway

**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-nilaway).**

3,765 stars · 88 forks · Go · apache-2.0

## Links

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

## Topics

`go` `nil-pointer` `nilability` `nilability-analysis` `static-analysis`

## Description

Nilaway is a static analysis tool and linter plugin for Go designed to identify potential nil pointer dereferences in source code to prevent runtime panics. It functions as an inter-procedural pointer analyzer that tracks data flow across functions and packages to detect memory safety issues.

The tool differentiates itself by tracking pointer states through anonymous functions, closures, and struct initializations. It employs a pointer analysis framework that monitors how values flow through a program to determine if a variable is safe to dereference at a specific point.

The analyzer can be integrated into continuous integration workflows and linting toolchains, exporting its findings in a structured format. It includes configuration utilities to filter analysis scope, allowing users to restrict checks to specific first-party packages.

## Tags

### Programming Languages & Runtimes

- [Nil Pointer Detection](https://awesome-repositories.com/f/programming-languages-runtimes/nil-pointer-detection.md) — Identifies potential nil pointer dereferences in Go source code to prevent runtime panics.
- [Inter-procedural Data Flow Analyzers](https://awesome-repositories.com/f/programming-languages-runtimes/compiler-interpreter-internals/compiler-toolchains/optimization-frameworks/static-analysis-optimizers/inter-procedural-data-flow-analyzers.md) — Tracks pointer states across function boundaries, including struct initializations and anonymous functions.
- [Interprocedural Pointer Analysis](https://awesome-repositories.com/f/programming-languages-runtimes/interprocedural-pointer-analysis.md) — Provides inter-procedural pointer analysis to track values across function and package boundaries.
- [Static Analysis Tools](https://awesome-repositories.com/f/programming-languages-runtimes/language-ecosystems-tooling/programming-environments-tooling/go-environments/static-analysis-tools.md) — Provides a pointer analysis framework to detect memory safety issues across Go packages.
- [Nil Dereference Detection](https://awesome-repositories.com/f/programming-languages-runtimes/nil-dereference-detection.md) — Identifies potential nil pointer dereferences during compilation to prevent runtime panics. ([source](https://github.com/uber-go/nilaway/blob/main/docs/index.md))
- [Pointer Analysis Frameworks](https://awesome-repositories.com/f/programming-languages-runtimes/pointer-analysis-frameworks.md) — Implements inter-procedural pointer tracking through struct initializations to detect potential nil dereferences. ([source](https://github.com/uber-go/nilaway/blob/main/docs/configurations.md))
- [Closure Analysis](https://awesome-repositories.com/f/programming-languages-runtimes/closure-analysis.md) — Tracks pointer flow through anonymous functions and closures to identify potential nil dereferences. ([source](https://github.com/uber-go/nilaway/blob/main/docs/configurations.md))
- [Context-Sensitive Analysis](https://awesome-repositories.com/f/programming-languages-runtimes/context-sensitive-analysis.md) — Implements context-sensitive modeling to differentiate between function calls and reduce false positives.
- [Flow-Sensitive Analysis](https://awesome-repositories.com/f/programming-languages-runtimes/flow-sensitive-analysis.md) — Tracks variable states across execution paths to precisely locate potential nil dereferences.
- [Go Development Workflows](https://awesome-repositories.com/f/programming-languages-runtimes/go-development-workflows.md) — Connects static analysis tools into Go development workflows via custom drivers and JSON output.
- [Nil Analysis Plugins](https://awesome-repositories.com/f/programming-languages-runtimes/language-ecosystems-tooling/programming-environments-tooling/go-environments/static-analysis-tools/go-linter-aggregators/nil-analysis-plugins.md) — Ships as a modular linter plugin that outputs pointer analysis results in JSON format.
- [Static Single Assignment Analysis](https://awesome-repositories.com/f/programming-languages-runtimes/variable-assignments/static-single-assignment-analysis.md) — Uses Static Single Assignment (SSA) form to track how pointer values flow through the program.

### Security & Cryptography

- [Go Source Code Analyzers](https://awesome-repositories.com/f/security-cryptography/source-code-vulnerability-scanning/go-source-code-analyzers.md) — Analyzes Go source code to detect potential nil pointer dereferences.

### Testing & Quality Assurance

- [Static Code Analysis](https://awesome-repositories.com/f/testing-quality-assurance/static-code-analysis.md) — Scans Go programs for bugs and safety violations without executing the code.
- [Analysis Scope Filters](https://awesome-repositories.com/f/testing-quality-assurance/code-quality-review/static-analysis/analysis-scope-filters.md) — Provides configuration to include or exclude specific packages to focus the analysis scope. ([source](https://github.com/uber-go/nilaway/blob/main/docs/developing.md))

### Development Tools & Productivity

- [Analysis Framework Drivers](https://awesome-repositories.com/f/development-tools-productivity/integrated-development-environment-plugins/linter-integrations/analysis-framework-drivers.md) — Integrates pointer checks as standalone binaries or plugins within analysis frameworks. ([source](https://cdn.jsdelivr.net/gh/uber-go/nilaway@main/README.md))
- [Linting Workflows](https://awesome-repositories.com/f/development-tools-productivity/linting-workflows.md) — Integrates pointer analysis into CI/CD pipelines as part of a broader set of static checks. ([source](https://github.com/uber-go/nilaway/blob/main/docs/developing.md))
