Преглед изворни кода

Close channel after the client is stopped

Audrius Butkevicius пре 10 година
родитељ
комит
73236e58c5
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      lib/relay/client/methods.go

+ 1 - 1
lib/relay/client/methods.go

@@ -109,8 +109,8 @@ func TestRelay(uri *url.URL, certs []tls.Certificate, sleep time.Duration, times
 	}
 	}
 	go c.Serve()
 	go c.Serve()
 	defer func() {
 	defer func() {
-		close(invs)
 		c.Stop()
 		c.Stop()
+		close(invs)
 	}()
 	}()
 
 
 	for i := 0; i < times; i++ {
 	for i := 0; i < times; i++ {