From c8557f7cba16593ebc81f8d48d925f8e187fc4a2 Mon Sep 17 00:00:00 2001 From: Wolfy-J Date: Mon, 11 Jun 2018 22:05:33 +0300 Subject: no library dependency --- service/container_test.go | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'service/container_test.go') diff --git a/service/container_test.go b/service/container_test.go index 34d8389e..5adc5d73 100644 --- a/service/container_test.go +++ b/service/container_test.go @@ -19,12 +19,13 @@ type testService struct { cfg Config c Container cfgE, serveE error - serving chan interface{} + done chan interface{} } func (t *testService) Configure(cfg Config, c Container) (enabled bool, err error) { t.cfg = cfg t.c = c + t.done = make(chan interface{}) return t.ok, t.cfgE } @@ -40,21 +41,12 @@ func (t *testService) Serve() error { t.setChan(nil) } - t.mu.Lock() - t.serving = make(chan interface{}) - t.mu.Unlock() - - <-t.serving - - t.mu.Lock() - t.serving = nil - t.mu.Unlock() - + <-t.done return nil } func (t *testService) Stop() { - close(t.serving) + close(t.done) } func (t *testService) waitChan() chan interface{} { -- cgit v1.2.3