Skip to content

Comment on How Go detects struct copies with sync.noCopyparent

Comments

I thought about it again, but you can of course use your own types in this very way. You can "test" if a struct has a certain (zero-sized, embedded) member. It's just cumbersome, and needs to be implemented through-out your code, so it's only suitable for very small "flagging" operations. It's not comparable to annotations in other languages.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.