Skip to content

Commit

Permalink
fix(socks): Fix the problem that wg.wait() is invalid due to the earl…
Browse files Browse the repository at this point in the history
…y termination of the main process before the coordination process executes wg.add(1).
  • Loading branch information
LanXuage committed Mar 1, 2023
1 parent 7ff3daf commit 8e965f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/socks.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ var socksCmd = &cobra.Command{
key := randomString(socks.KeyLength)

var wg sync.WaitGroup
wg.Add(1)
go func() {
wg.Add(1)
defer wg.Done()
socks.Serve(lp, sp, key)
}()
Expand Down

0 comments on commit 8e965f8

Please sign in to comment.