Skip to content

x/net/context: go vet fails because of copied Mutex #14839

@bernerdschaefer

Description

@bernerdschaefer
  1. What version of Go are you using (go version)?
go version go1.6 linux/amd64
  1. What operating system and processor architecture are you using (go env)?
GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
  1. What did you do?
    If possible, provide a recipe for reproducing the error.
    A complete runnable program is good.
    A link on play.golang.org is best.

Ran go vet ./... on a project with golang.org/x/net/context/context.go in vendor/.

Also tried running go vet on a fresh clone of https://github.com/golang/net.

  1. What did you expect to see?

go vet to exit with status 0.

  1. What did you see instead?
context.go:218: newCancelCtx returns lock by value: context.cancelCtx contains sync.Mutex
exit status 1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions