Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/go/analysis/passes/nilness: check pointers inside structs as well #43301

Open
ainar-g opened this issue Dec 21, 2020 · 1 comment
Open

x/tools/go/analysis/passes/nilness: check pointers inside structs as well #43301

ainar-g opened this issue Dec 21, 2020 · 1 comment

Comments

@ainar-g
Copy link
Contributor

@ainar-g ainar-g commented Dec 21, 2020

nilness currently (as of golang/tools@ae774e9 with Go 1.15.6) correctly reports this issue:

if pmax == nil {
        max = *pmax
}

But not this one:

if v.max == nil {
        max = *v.max
}

Full reproduction code.

@gopherbot gopherbot added this to the Unreleased milestone Dec 21, 2020
@ainar-g ainar-g changed the title x/tools/go/analysis/passes/nilness: check pointers insite structs as well x/tools/go/analysis/passes/nilness: check pointers inside structs as well Dec 21, 2020
@cagedmantis
Copy link
Contributor

@cagedmantis cagedmantis commented Dec 21, 2020

/cc @matloob

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants