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 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

This comment has been minimized.

Copy link
Contributor Author

@valyala valyala commented Dec 19, 2016

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Dec 19, 2016

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

@rakyll rakyll added this to the Go1.8 milestone Dec 19, 2016
@gopherbot gopherbot closed this in d160982 Dec 24, 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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.