mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
fix(client/snowflake.go): prevent wg.Add race condition
In VSCode, the staticcheck tool emits this warning: > should call wg.Add(1) before starting the goroutine to > avoid a race (SA2000)go-staticcheck To avoid this warning, just move wg.Add outside.
This commit is contained in:
parent
8e0b5bd20a
commit
aefabe683f
1 changed files with 1 additions and 1 deletions
|
@ -56,8 +56,8 @@ func socksAcceptLoop(ln *pt.SocksListener, transport *sf.Transport, shutdown cha
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
log.Printf("SOCKS accepted: %v", conn.Req)
|
log.Printf("SOCKS accepted: %v", conn.Req)
|
||||||
|
wg.Add(1)
|
||||||
go func() {
|
go func() {
|
||||||
wg.Add(1)
|
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
defer conn.Close()
|
defer conn.Close()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue