|
|
|
@ -2,12 +2,13 @@ package singleflight |
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
|
"context" |
|
|
|
|
"github.com/go-kratos/kratos/v2/middleware" |
|
|
|
|
"github.com/go-kratos/kratos/v2/transport" |
|
|
|
|
"github.com/go-kratos/kratos/v2/transport/grpc" |
|
|
|
|
"sync" |
|
|
|
|
"testing" |
|
|
|
|
"time" |
|
|
|
|
|
|
|
|
|
"github.com/go-kratos/kratos/v2/middleware" |
|
|
|
|
"github.com/go-kratos/kratos/v2/transport" |
|
|
|
|
"github.com/go-kratos/kratos/v2/transport/grpc" |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
type testVali struct { |
|
|
|
@ -76,7 +77,6 @@ func TestUse(t *testing.T) { |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 测试不使用单飞时
|
|
|
|
|
func TestNoUse(t *testing.T) { |
|
|
|
|
var mu sync.Mutex |
|
|
|
|