We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
vet currently warns when a function is declared to take a Lock , but not for function types or if the function is a function literal.
vet
<dgryski@kaepora[w] \ʕ◔ϖ◔ʔ/ > cat main.go package main import "sync" var f2 func(sync.Mutex) = func(mu sync.Mutex) {} func f(mu sync.Mutex) {} <dgryski@kaepora[w] \ʕ◔ϖ◔ʔ/ > go vet main.go main.go:7: f passes Lock by value: sync.Mutex exit status 1
The text was updated successfully, but these errors were encountered:
Good find. This is probably relatively straightforward, if you have any interest in tackling it. It probably consists of locating and extracting the relevant types and running them through lockPath. See https://github.com/golang/tools/blob/master/cmd/vet/copylock.go, https://github.com/golang/tools/blob/master/cmd/vet/testdata/copylock_func.go, and https://github.com/golang/tools/blob/master/cmd/vet/testdata/copylock_range.go.
Sorry, something went wrong.
CL https://golang.org/cl/11051 mentions this issue.
ff8f3f0
No branches or pull requests
vet
currently warns when a function is declared to take a Lock , but not for function types or if the function is a function literal.The text was updated successfully, but these errors were encountered: