We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8ca8b96 commit 50a1d31Copy full SHA for 50a1d31
waitgroups/rate-limiting/server.go
@@ -21,9 +21,9 @@ func main() {
21
}
22
connections++
23
24
- go func() {
+ go func(con net.Conn) {
25
defer func() {
26
- _ = conn.Close()
+ _ = con.Close()
27
atomic.AddInt32(&connections, -1)
28
}()
29
if atomic.LoadInt32(&connections) > 3 {
@@ -36,6 +36,6 @@ func main() {
36
if err != nil {
37
log.Fatalf("could not write to connection: %v", err)
38
39
- }()
+ }(conn)
40
41
0 commit comments