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/copylock: detect copylock in multi-assignment #319
Conversation
This PR (HEAD: f7e5aec) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/tools/+/323589 to see it. Tip: You can toggle comments from me using the |
Message from Go Bot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from Tim King: Patch Set 1: Run-TryBot+1 (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from Go Bot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from kokoro: Patch Set 1: Kokoro presubmit build starting for golang/tools/gopls-legacy/presubmit Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from Go Bot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from kokoro: Patch Set 1: gopls-CI+1 Kokoro presubmit build finished with status: SUCCESS Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from Go Bot: Patch Set 1: TryBot-Result-1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
This PR (HEAD: c49301b) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/tools/+/323589 to see it. Tip: You can toggle comments from me using the |
Message from Tim King: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from Andrew Wansink: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from Tim King: Patch Set 2: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from Go Bot: Patch Set 2: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from kokoro: Patch Set 2: Kokoro presubmit build starting for golang/tools/gopls-legacy/presubmit Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from Go Bot: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from kokoro: Patch Set 2: gopls-CI+1 Kokoro presubmit build finished with status: SUCCESS Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from Go Bot: Patch Set 2: TryBot-Result-1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
c49301b
to
ac5c6e1
Compare
This PR (HEAD: ac5c6e1) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/tools/+/323589 to see it. Tip: You can toggle comments from me using the |
Message from Andrew Wansink: Patch Set 3: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from Tim King: Patch Set 3: Run-TryBot+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from Go Bot: Patch Set 3: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from kokoro: Patch Set 3: Kokoro presubmit build starting for golang/tools/gopls-legacy/presubmit Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from kokoro: Patch Set 3: gopls-CI+1 Kokoro presubmit build finished with status: SUCCESS Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from Go Bot: Patch Set 3: TryBot-Result-1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from Andrew Wansink: Patch Set 3: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from Tim King: Patch Set 3: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from Go Bot: Patch Set 5: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from Go Bot: Patch Set 5: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from Go Bot: Patch Set 5: TryBot-Result-1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from Tim King: Patch Set 5: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
This PR (HEAD: 0b1f2d0) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/tools/+/323589 to see it. Tip: You can toggle comments from me using the |
Message from Andrew Wansink: Patch Set 6: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from Andrew Wansink: Patch Set 6: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from Tim King: Patch Set 6: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from Go Bot: Patch Set 6: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from Go Bot: Patch Set 6: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from kokoro: Patch Set 6: Kokoro presubmit build starting for golang/tools/gopls-legacy/presubmit Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from kokoro: Patch Set 6: gopls-CI-1 Kokoro presubmit build finished with status: FAILURE Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from Go Bot: Patch Set 6: TryBot-Result-1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from Tim King: Patch Set 6: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
The existing implementation does not identify lock copies when doing multi-assignment, i.e. foo, ok := someMap["key"] Currently, it will find issue with similar code foo := someMap["key"]. This discrepency is because a return type of Tuple was not considered when resolving the type of the right hand side of the assignment. Fixes #45896
This PR (HEAD: bb51bdd) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/tools/+/323589 to see it. Tip: You can toggle comments from me using the |
Message from Andrew Wansink: Patch Set 6: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from Tim King: Patch Set 7: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from Go Bot: Patch Set 7: (2 comments) Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from kokoro: Patch Set 7: Kokoro presubmit build starting for golang/tools/gopls-legacy/presubmit Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from kokoro: Patch Set 7: gopls-CI+1 Kokoro presubmit build finished with status: SUCCESS Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from Go Bot: Patch Set 7: TryBot-Result+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from Andrew Wansink: Patch Set 7: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
Message from Tim King: Patch Set 7: Code-Review+2 Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
The existing implementation does not identify lock copies when doing multi-assignment, i.e. foo, ok := someMap["key"] Currently, it will find issue with similar code foo := someMap["key"]. This discrepency is because a return type of Tuple was not considered when resolving the type of the right hand side of the assignment. Fixes #45896 Change-Id: I93266dbd03a301ff558d826ff4fe70fc0344cb77 GitHub-Last-Rev: bb51bdd GitHub-Pull-Request: #319 Reviewed-on: https://go-review.googlesource.com/c/tools/+/323589 Run-TryBot: Tim King <taking@google.com> gopls-CI: kokoro <noreply+kokoro@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Tim King <taking@google.com> Trust: Robert Findley <rfindley@google.com>
Message from Robert Findley: Patch Set 7: Trust+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/323589. |
This PR is being closed because golang.org/cl/323589 has been merged. |
The existing implementation does not identify lock copies when doing
multi-assignment, i.e. foo, ok := someMap["key"]
Currently, it will find issue with similar code foo := someMap["key"].
This discrepency is because a return type of Tuple was not considered
when resolving the type of the right hand side of the assignment.
Fixes #45896