Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/vet: No warning for copying structs containing mutex by value in for-range loop #8356
What does 'go version' print? go version go1.3 linux/amd64 What steps reproduce the problem? Any program where a slice of structs (not pointes to structs) containing locking primitives by value is iterated over with range-for, and the locks are used in the loop body. 1. http://play.golang.org/p/FMsMT0dnhf What happened? Go vet didn't warn that the locking/unlocking would be rendered useless by this action. Even though I expected it to because it also warns on returning such structs by value from functions and the like. What should have happened instead? Go vet should've warned me that this was dangerous.
This issue was closed.