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

Add more test cases for calling no-return functions #252

Closed yuxincs closed 5 months ago

yuxincs commented 6 months ago

This PR adds more test cases to test NilAway's ability to handle no-return functions (such as os.Exit, runtime.Goexit, testing.T.SkipNow etc.).

codecov[bot] commented 6 months ago

Codecov Report

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

Project coverage is 87.55%. Comparing base (885be9d) to head (422fc25).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #252 +/- ## ======================================= Coverage 87.55% 87.55% ======================================= Files 63 63 Lines 7828 7828 ======================================= Hits 6854 6854 Misses 796 796 Partials 178 178 ```

: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, 885be9d) 3296 errors on test branch (995a6d8)

yuxincs commented 5 months ago

Actually, instead of doing hacky postfixes in NilAway, we should just fix ctrlflow analyzer: https://github.com/golang/tools/pull/497

Will repurpose this PR to just introduce those valuable test cases instead :)