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
I see you fixed the original issue by switching to atomic.AddUint64.
I think the new error is guarding against what's usually a bug since you can't store a negative number in an unsigned integer.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
https://play.golang.org/p/Qf-Pfg1vzeZ
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
atomic.AddUint64(&foo, ^(0))
according to this
go/src/sync/atomic/doc.go
Lines 103 to 106 in 509ee70
What did you expect to see?
compile success, decrement
uint64(0)
got undefined behavior.What did you see instead?
constant -1 overflows uint64
The text was updated successfully, but these errors were encountered: