mirror of
https://github.com/tursom/GoCollections.git
synced 2025-03-22 16:00:06 +08:00
16 lines
218 B
Go
16 lines
218 B
Go
package atomic
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
func TestGetAtomizer(t *testing.T) {
|
|
atomizer := GetAtomizer[int32]()
|
|
var ref *int32
|
|
var obj int32 = 1
|
|
atomizer.CompareAndSwap()(&ref, nil, &obj)
|
|
|
|
fmt.Println(*ref)
|
|
}
|