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 ErrorOnNilableMap handling #243

Closed yuxincs closed 6 months ago

yuxincs commented 6 months ago

Reading from a nil map does not really panic and is actually used quite frequently in Go. When NilAway was initially developed we added a feature that errs when a nilable map is accessed, and guard it under an internal feature flag for us to see more data points. Now that NilAway is more mature and we have seen more real world examples, this PR removes such handling and the stale feature flag.

codecov[bot] commented 6 months ago

Codecov Report

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

Project coverage is 87.50%. Comparing base (a25d53b) to head (fcf4c78).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #243 +/- ## ========================================== + Coverage 87.44% 87.50% +0.06% ========================================== Files 61 61 Lines 7804 7798 -6 ========================================== Hits 6824 6824 + Misses 801 796 -5 + Partials 179 178 -1 ```

: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, a25d53b) 3296 errors on test branch (dc5eb34)