mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-17 16:12:42 +08:00
20 lines
242 B
Go
20 lines
242 B
Go
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")
|
|
}
|