Skip to content

cmd/vet: vet is reporting lock value copying because of a Lock method unrelated to mutexes #18451

Closed
@dlecorfec

Description

@dlecorfec

go version go1.7.3 linux/amd64

A method named Lock() on a struct is enough to trigger the vet lock copy warning. See https://play.golang.org/p/V2v2w7DPAM

What did you expect to see?

$ go vet
$

What did you see instead?

$ go vet
main.go:11: assignment copies lock value to b: main.A
main.go:12: assignment copies lock value to _: main.A
exit status 1
$

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions