You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.