mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Fix the format issue
This commit is contained in:
parent
1b700e5ed8
commit
2d2a95c3fb
@ -26,13 +26,13 @@ type StubServer struct {
|
||||
s *grpc.Server
|
||||
|
||||
cleanups []func() // Lambdas executed in Stop(); populated by Start().
|
||||
started chan struct{}
|
||||
started chan struct{}
|
||||
}
|
||||
|
||||
func New(testService testpb.TestServiceServer) *StubServer {
|
||||
return &StubServer{
|
||||
testService: testService,
|
||||
started: make(chan struct{}),
|
||||
started: make(chan struct{}),
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,6 +67,7 @@ func (ss *StubServer) Start(sopts []grpc.ServerOption, dopts ...grpc.DialOption)
|
||||
// Stop stops ss and cleans up all resources it consumed.
|
||||
func (ss *StubServer) Stop() {
|
||||
<-ss.started
|
||||
|
||||
for i := len(ss.cleanups) - 1; i >= 0; i-- {
|
||||
ss.cleanups[i]()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user