nilaway icon indicating copy to clipboard operation
nilaway copied to clipboard

Static analysis tool to detect potential nil panics in Go code

Results 116 nilaway issues
Sort by recently updated
recently updated
newest added

NilAway reports a false positive in the below example. It is incorrectly making an association between the two invocations of `foo` in `bar` and `testFoo`. ``` L91. func foo(p *int)...

enhancement

Affiliations analysis fails to capture nested composite literal for slice type. It does not report any error for the below test case. ``` type A1 struct{} func (A1) foo(x *int)...

enhancement

NilAway currently does not handle anonymous functions in the affiliation analysis. Now with the anonymous function support added in NilAway (under a feature flag), we should extend to support this...

enhancement

Implement special handling for `init`. Below is an example where a false positive is reported. ``` var _x *int func init() { _x = new(int) } func test() { _...

enhancement
good first issue

Currently, our inference algorithm requires that the evaluation order of triggers and sites be ordered to have deterministic error generations. Consider the following example: ``` func f1(p *int) { //...

enhancement

We have defined `annotation.Prestring` in our codebase which is equivalent to `fmt.Stringer`. We should remove this redundant definition and directly use `fmt.Stringer` instead.

enhancement

Go exposes "abnormal" control flow primitives, such as the following - defer - panic - recover - os.Exit - log.Fatal Currently, NilAway reports false positives in these cases. We must...

enhancement

For code example below, ``` func foo(x *int) { x = nil y := x z := y print(*z) // L30. Error reported here } ``` NilAway prints the error...

enhancement

Thrift/Protobuf protocols used extensively in enterprise settings. They are implemented as code generators in Go. When analyzing the generated code, NilAway does not know if some fields are nilable/nonnil. We...

enhancement

We can report errors on `pkg A` when we are analyzing `pkg B` due to our multi-pkg inference. However, nogo’s support for nolint comments is based on reading the AST...

enhancement