mirror of
https://github.com/tursom/GoCollections.git
synced 2025-03-25 10:10:07 +08:00
16 lines
228 B
Go
16 lines
228 B
Go
package lang
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
func TestThreadLocalImpl(t1 *testing.T) {
|
|
local := NewThreadLocal[int]()
|
|
fmt.Println(local.Get())
|
|
local.Put(1)
|
|
fmt.Println(local.Get())
|
|
local.Remove()
|
|
fmt.Println(local.Get())
|
|
}
|