Open k4n4ry opened 5 months ago
@k4n4ry, thank you for submitting the PR! We'll take a look soon and follow up with you.
Attention: Patch coverage is 96.00000%
with 2 lines
in your changes missing coverage. Please review.
Project coverage is 87.70%. Comparing base (
c91e71c
) to head (9c61f48
).
Files with missing lines | Patch % | Lines |
---|---|---|
assertion/global/analyzer.go | 92.85% | 1 Missing and 1 partial :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
package sxn01
var (
b *int
)
func init() {
init_b_val()
}
func init_b_val() {
b = new(int)
}
func use_global_var() {
*b = 20
}
The above code triggers a false positive
@SongShawn Thanks for the review. I've updated the function to retrieve not only the init functions but also all functions called directly or indirectly from them. https://github.com/uber-go/nilaway/pull/253/commits/dce532a2509d6ebfb1452310abf809847b289370
@sonalmahajan15 Hello, could you please rerun the CI and review this code? Thank you.
I'm updating your branch since we recently merged CI fixes, which are required for the CI to pass on forked repositories. I'll review the code this week :)
[!WARNING]
❌ NilAway errors reported on stdlib are different 📉.3271 errors on base branch (main, c91e71c) 2968 errors on test branch (69d920e)
fixes #56
run()
to retrieve the init function from the file.getGlobalConsumers()
, analyzed assignments to global variables from the init function and used it as one of the criteria for determining consumer creation.Please provide comments if this implementation differs from nilaway's coding practices or design principles. Thank you.