Skip to content

Conversation

vladmsnk
Copy link

The httptest.NewServer function starts a background goroutine to serve HTTP requests. Without explicitly closing the server, this goroutine can continue running even after the test completes, leading to resource leaks.
This change adds a defer srv.Close() call immediately after server creation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant