uber-go / nilaway

Static analysis tool to detect potential nil panics in Go code
Apache License 2.0
3.2k stars 66 forks source link

Refine the handling of pointers in `TypeAsDeepType` #251

Closed sonalmahajan15 closed 3 months ago

sonalmahajan15 commented 6 months ago

This PR refines the handling of *types.Pointer in TypeAsDeepType to only consider a pointer type deep if its underlying elements are of a deep type. The implication of always considering a pointer deep was that for type like var x *int; foo(x), unnecessary deep triggers were being created. The change in this PR reduces the creation of these redundant triggers.

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 87.60%. Comparing base (4f33d8c) to head (0204bd5). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #251 +/- ## ========================================== - Coverage 87.63% 87.60% -0.03% ========================================== Files 63 63 Lines 7926 7916 -10 ========================================== - Hits 6946 6935 -11 + Misses 800 799 -1 - Partials 180 182 +2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

github-actions[bot] commented 6 months ago

Golden Test

[!NOTE]
✅ NilAway errors reported on standard libraries are identical.

3271 errors on base branch (main, 4f33d8c) 3271 errors on test branch (b2560db)