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

cmd/vet: false positive copylocks check on len(array) and cap(array) #18374

Closed
valyala opened this issue Dec 19, 2016 · 2 comments
Closed

cmd/vet: false positive copylocks check on len(array) and cap(array) #18374

valyala opened this issue Dec 19, 2016 · 2 comments
Milestone

Comments

@valyala
Copy link
Contributor

valyala commented Dec 19, 2016

The commit bd9aa98 introduced false positive for copylocks check in `go tool vet':

var a [5]sync.Mutex

// vet incorrectly emits 'function call copies lock value: sync.Mutex' on the following lines:
n := len(a)
m := cap(a)

The commit bd9aa98 was introduced in go1.8, so this false positive should be fixed in go1.8 too.

I'll send the corresponding CL fixing this issue in a few minutes.

@valyala
Copy link
Contributor Author

valyala commented Dec 19, 2016

The CL is https://go-review.googlesource.com/34630 .

@gopherbot
Copy link

CL https://golang.org/cl/34630 mentions this issue.

@rakyll rakyll added this to the Go1.8 milestone Dec 19, 2016
@golang golang locked and limited conversation to collaborators Dec 24, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants