We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
What version of Go are you using (go version)?
go version
go 1.6
What operating system and processor architecture are you using (go env)?
go env
linux/amd64
What did you do? If possible, provide a recipe for reproducing the error. A complete runnable program is good. A link on play.golang.org is best.
Consider a program like the following (play.golang.org link):
package main import ( "fmt" "sync/atomic" ) func main() { var c int64 for i := 0; i < 10; i++ { go func() { for { c := atomic.AddInt64(&c, 1) if c%10000000 == 0 { fmt.Println(c) } } }() } select {} }
What did you expect to see?
Since the c in the inner function is a different c from the outer atomic counter, I expected vet to not complain.
c
What did you see instead?
go vet gives the following output:
go vet
test.go:13: direct assignment to atomic value
The text was updated successfully, but these errors were encountered:
CL https://golang.org/cl/21526 mentions this issue.
Sorry, something went wrong.
0d37538
No branches or pull requests
go 1.6
linux/amd64
Consider a program like the following (play.golang.org link):
Since the
c
in the inner function is a differentc
from the outer atomic counter, I expected vet to not complain.go vet
gives the following output:The text was updated successfully, but these errors were encountered: