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.
The text was updated successfully, but these errors were encountered:
This issue was closed.