github.com/tursom/GoCollections@v0.3.10/lang/atomic/Atomic_test.go (about) 1 package atomic 2 3 import ( 4 "fmt" 5 "testing" 6 ) 7 8 func TestGetAtomizer(t *testing.T) { 9 atomizer := GetAtomizer[int32]() 10 var ref *int32 11 var obj int32 = 1 12 atomizer.CompareAndSwap()(&ref, nil, &obj) 13 14 fmt.Println(*ref) 15 }