mirror of
https://github.com/valyala/fasthttp.git
synced 2026-06-14 15:56:44 +03:00
0643f42190
deferInLoop was disabled in .golangci.yml, so CI could not catch defer statements added inside for loops. Such defers run only at function exit, not per iteration, leaking file descriptors, connections, or locks under load. Re-enable the check and fix the two existing occurrences in test code instead of excluding test files: - inmemory listener test: deferred conn.Close() inside the accept loop; move the per-connection handling into a closure so each connection is closed when done. - TestClientManyServers: every server must stay up until the test ends, so hoist the defer out of the loop and stop all servers in a single deferred loop. Fixes #2233 Signed-off-by: Y.Horie <u5.horie@gmail.com>