From 6b88862b90bf42e8551140cd281158ab908d4baf Mon Sep 17 00:00:00 2001 From: XinRoom <32238570+XinRoom@users.noreply.github.com> Date: Thu, 12 May 2022 12:49:26 +0800 Subject: [PATCH] Fixed a deadlock issue introduced in the last commit --- cmd/go-portScan.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cmd/go-portScan.go b/cmd/go-portScan.go index 4a2320c..91977b5 100644 --- a/cmd/go-portScan.go +++ b/cmd/go-portScan.go @@ -225,10 +225,11 @@ func run(c *cli.Context) error { } } } - wgScan.Wait() // 扫描器-发 - wgPing.Wait() // PING组 - s.Wait() // 扫描器-等 - s.Close() // 扫描器-收 + wgScan.Wait() // 扫描器-发 + wgPing.Wait() // PING组 + s.Wait() // 扫描器-等 + s.Close() // 扫描器-收 + close(retChan) <-single // 接收器-收 wgPortIdentify.Wait() // 识别器-收 fmt.Printf("[*] elapsed time: %s\n", time.Since(start))