src/cmd/vet/testdata/atomic/atomic.go
raw| 1 | // Copyright 2013 The Go Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style |
| 3 | // license that can be found in the LICENSE file. |
| 4 | |
| 5 | // This file contains tests for the atomic checker. |
| 6 | |
| 7 | package atomic |
| 8 | |
| 9 | import "sync/atomic" |
| 10 | |
| 11 | func AtomicTests() { |
| 12 | x := uint64(1) |
| 13 | x = atomic.AddUint64(&x, 1) // ERROR "direct assignment to atomic value" |
| 14 | } |