uber-go / nilaway

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

Remove util.TypeOf helper function #242

Closed yuxincs closed 6 months ago

yuxincs commented 6 months ago

This PR simply removes the helper function util.TypeOf. Although it shortens the call from pass.TypesInfo.TypeOf, it increases the cognitive load such that we do not know which we should use in NilAway's codebase and we don't know if util.TypeOf has any special handling (it doesn't!). Moreover, we're using a mixture of these two functionally-identical expressions in our codebase.

Removal of such a helper function reduces confusions and helps maintainability.

codecov[bot] commented 6 months ago

Codecov Report

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

Project coverage is 87.44%. Comparing base (3062237) to head (310e4b5).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #242 +/- ## ========================================== - Coverage 87.44% 87.44% -0.01% ========================================== Files 61 61 Lines 7808 7804 -4 ========================================== - Hits 6828 6824 -4 Misses 801 801 Partials 179 179 ```

: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.

3296 errors on base branch (main, 3062237) 3296 errors on test branch (1b6d0c4)