2 ms·
i wonder if it might be helpful to go a step further and define an alias type that has the tag applied and accesses examined? // +checkatomic type atom
by maerF0x0 5y ago
i wonder if it might be helpful to go a step further and define an alias type that has the tag applied and accesses examined?
// +checkatomic
type atomicint int64
type mystruct struct {
count atomicint
}
- numbsafari 5y agoWhat’s nice about the current approach is that it is explicitly stated at the point of the variable declaration, and not hidden away in some far off place. Also, it doesn’t require you to import a package, it’s completely orthogonal to the consumer of the code. They can opt in if they want, others aren’t forced to import anything.