Skip to content

go/analysis/passes/nilness: fixed slice not being considered as non-nil #291

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

Closed
wants to merge 6 commits into from

Conversation

komem3
Copy link
Contributor

@komem3 komem3 commented Mar 23, 2021

The initialized slice will always be non-nil.
But, nilness could not detect it, so I fixed it.

Fixes golang/go#45177

@google-cla google-cla bot added the cla: yes label Mar 23, 2021
@gopherbot
Copy link
Contributor

This PR (HEAD: e4cbb19) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/tools/+/303890 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 1:

Congratulations on opening your first change. Thank you for your contribution!

Next steps:
A maintainer will review your change and provide feedback. See
https://golang.org/doc/contribute.html#review for more info and tips to get your
patch through code review.

Most changes in the Go project go through a few rounds of revision. This can be
surprising to people new to the project. The careful, iterative review process
is our way of helping mentor contributors and ensuring that their contributions
have a lasting impact.


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Tim King:

Patch Set 1: Code-Review-2

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Tim King:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Tim King:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: b22d8f6) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/tools/+/303890 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Koumei Mikuni:

Patch Set 2:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Tim King:

Patch Set 2: Code-Review-2

(3 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: b9e18f0) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/tools/+/303890 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Koumei Mikuni:

Patch Set 3:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Guodong Li:

Patch Set 3:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Tim King:

Patch Set 3: -Code-Review

(3 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 0c039b7) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/tools/+/303890 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Koumei Mikuni:

Patch Set 4:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Tim King:

Patch Set 4: Run-TryBot+1 Code-Review+2

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 4:

TryBots beginning. Status page: https://farmer.golang.org/try?commit=1ea9bdb9


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from kokoro:

Patch Set 4:

Kokoro presubmit build starting for golang/tools/gopls-legacy/presubmit
Logs at:
https://source.cloud.google.com/results/invocations/4eeb4b2e-338a-46b5-8580-f376401e6ceb


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from kokoro:

Patch Set 4: gopls-CI+1

Kokoro presubmit build finished with status: SUCCESS
Logs at: https://source.cloud.google.com/results/invocations/4eeb4b2e-338a-46b5-8580-f376401e6ceb


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 4: TryBot-Result+1

TryBots are happy.


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Dmitri Shuralyov:

Patch Set 4: Trust+1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Koumei Mikuni:

Patch Set 5:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Dmitri Shuralyov:

Patch Set 5: Run-TryBot+1 Trust+1

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 5:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from kokoro:

Patch Set 5:

Kokoro presubmit build starting for golang/tools/gopls-legacy/presubmit
Logs at:
https://source.cloud.google.com/results/invocations/3bbb7dfc-8f41-4da0-9376-51a70c53b350


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 5:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Tim King:

Patch Set 5: Code-Review+2

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from kokoro:

Patch Set 5: gopls-CI+1

Kokoro presubmit build finished with status: SUCCESS
Logs at: https://source.cloud.google.com/results/invocations/3bbb7dfc-8f41-4da0-9376-51a70c53b350


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Dmitri Shuralyov:

Patch Set 5:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 5: TryBot-Result-1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 5: TryBot-Result-1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Koumei Mikuni:

Patch Set 6:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Dmitri Shuralyov:

Patch Set 6: Run-TryBot+1 Trust+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 6:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from kokoro:

Patch Set 6:

Kokoro presubmit build starting for golang/tools/gopls-legacy/presubmit
Logs at:
https://source.cloud.google.com/results/invocations/12ae0214-257f-41ea-bb75-e3b2e2fba5a2


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from kokoro:

Patch Set 6: gopls-CI+1

Kokoro presubmit build finished with status: SUCCESS
Logs at: https://source.cloud.google.com/results/invocations/12ae0214-257f-41ea-bb75-e3b2e2fba5a2


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 6: TryBot-Result+1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: a1ffad5) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/tools/+/303890 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Dmitri Shuralyov:

Patch Set 7: Run-TryBot+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 7:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from kokoro:

Patch Set 7:

Kokoro presubmit build starting for golang/tools/gopls-legacy/presubmit
Logs at:
https://source.cloud.google.com/results/invocations/b652a639-e77e-4f78-bf95-c06d6280f9e2


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 7:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from kokoro:

Patch Set 7: gopls-CI+1

Kokoro presubmit build finished with status: SUCCESS
Logs at: https://source.cloud.google.com/results/invocations/b652a639-e77e-4f78-bf95-c06d6280f9e2


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 7: TryBot-Result-1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: f3a532e) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/tools/+/303890 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Koumei Mikuni:

Patch Set 8:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Tim King:

Patch Set 8: Run-TryBot+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 8:

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Dmitri Shuralyov:

Patch Set 8: Run-TryBot+1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from kokoro:

Patch Set 8:

Kokoro presubmit build starting for golang/tools/gopls-legacy/presubmit
Logs at:
https://source.cloud.google.com/results/invocations/2de7dcf3-17ff-41ce-a5b9-c53a9a0ec7fd


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Dmitri Shuralyov:

Patch Set 8: Code-Review+1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from kokoro:

Patch Set 8: gopls-CI+1

Kokoro presubmit build finished with status: SUCCESS
Logs at: https://source.cloud.google.com/results/invocations/2de7dcf3-17ff-41ce-a5b9-c53a9a0ec7fd


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 8: TryBot-Result+1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Tim King:

Patch Set 8: Code-Review+2


Please don’t reply on this GitHub thread. Visit golang.org/cl/303890.
After addressing review feedback, remember to publish your drafts!

gopherbot pushed a commit that referenced this pull request May 17, 2022
The initialized slice will always be non-nil.
But, nilness could not detect it, so I fixed it.

Fixes golang/go#45177

Change-Id: I3bad2b8dee16331c4a24d2e93fb4baacd98f30ec
GitHub-Last-Rev: f3a532e
GitHub-Pull-Request: #291
Reviewed-on: https://go-review.googlesource.com/c/tools/+/303890
Run-TryBot: Tim King <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
Reviewed-by: Tim King <[email protected]>
gopls-CI: kokoro <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Run-TryBot: Dmitri Shuralyov <[email protected]>
@gopherbot
Copy link
Contributor

This PR is being closed because golang.org/cl/303890 has been merged.

@gopherbot gopherbot closed this May 17, 2022
@komem3 komem3 deleted the fix-slice-to-be-non-nil branch May 18, 2022 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

x/tools/go/analysis/passes/nilness: not report slice as non-nil
2 participants