Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/vet: detect misuse of atomic.AddUint64 etc #4065

Closed
rsc opened this issue Sep 11, 2012 · 6 comments
Closed

cmd/vet: detect misuse of atomic.AddUint64 etc #4065

rsc opened this issue Sep 11, 2012 · 6 comments
Labels
FrozenDueToAge Suggested Issues that may be good for new contributors looking for work to do.
Milestone

Comments

@rsc
Copy link
Contributor

rsc commented Sep 11, 2012

This is a common mistake pattern

x = atomic.AddUint64(&x, 1)

Should be easy to detect with vet. A little obscure perhaps but easy.
@dvyukov
Copy link
Member

dvyukov commented Sep 11, 2012

Comment 1:

Another common misuse is Add(&x, 0) it should be replaced with Load(&x).

@rsc
Copy link
Contributor Author

rsc commented Sep 12, 2012

Comment 2:

Labels changed: added go1.1.

@rsc
Copy link
Contributor Author

rsc commented Dec 10, 2012

Comment 3:

Labels changed: added size-m.

@rsc
Copy link
Contributor Author

rsc commented Dec 10, 2012

Comment 4:

Labels changed: added suggested.

@gopherbot
Copy link

Comment 5 by divoxx:

My attempt to add this feature to go vet: https://golang.org/cl/7097048
This is my first contribution to the project, let me know if I'm not doing anything
right.

@rsc
Copy link
Contributor Author

rsc commented Jan 30, 2013

Comment 6:

This issue was closed by revision 6073176.

Status changed to Fixed.

@rsc rsc added fixed Suggested Issues that may be good for new contributors looking for work to do. labels Jan 30, 2013
@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge Suggested Issues that may be good for new contributors looking for work to do.
Projects
None yet
Development

No branches or pull requests

3 participants