mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-18 00:22:41 +08:00
locker
This commit is contained in:
19
locker/chan_source_locker_test.go
Normal file
19
locker/chan_source_locker_test.go
Normal file
@ -0,0 +1,19 @@
|
||||
package locker_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/charlienet/go-mixed/locker"
|
||||
)
|
||||
|
||||
func TestChanSourceLocker(t *testing.T) {
|
||||
l := locker.NewChanSourceLocker()
|
||||
c, ok := l.Get("aaaa")
|
||||
if ok {
|
||||
<-c
|
||||
|
||||
println("ok")
|
||||
}
|
||||
|
||||
println("fail")
|
||||
}
|
Reference in New Issue
Block a user