atomic.go 364 B

1234567891011121314
  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. // This file contains tests for the atomic checker.
  5. package atomic
  6. import "sync/atomic"
  7. func AtomicTests() {
  8. x := uint64(1)
  9. x = atomic.AddUint64(&x, 1) // ERROR "direct assignment to atomic value"
  10. }