Closed
Description
From a conversation with Alan Donovan about how we might detect accidental copies of types that shouldn't be copyable, I proposed: package runtime // or wherever // NoCopy is an annotation that the containing type shouldn't be copied // by value. It has zero size so may be embedded freely. type NoCopy struct{} Then we could do govet checks. Or even compiler checks (more controversial probably). Then sync.Cond and sync.Mutex could use it. The latter has no checks, because sync.Cond's runtime copyChecker takes up space. Only tagging this Go1.4 for eventual discussion.