Skip to content

fix: Remove deprecated http.CloseNotifier and replace with#4588

Open
JiwaniZakir wants to merge 2 commits intogin-gonic:masterfrom
JiwaniZakir:fix/issue-4586
Open

fix: Remove deprecated http.CloseNotifier and replace with#4588
JiwaniZakir wants to merge 2 commits intogin-gonic:masterfrom
JiwaniZakir:fix/issue-4586

Conversation

@JiwaniZakir
Copy link

Fixes #4586

Removes the deprecated http.CloseNotifier interface from ResponseWriter in response_writer.go, which was removed from Go's standard library and caused compilation warnings. The Stream function in context.go relied on w.CloseNotify() to detect client disconnection, which no longer works with modern Go. Replaces the call with c.Request.Context().Done(), the idiomatic Go approach for detecting request cancellation. Verified by updating response_writer_test.go to remove the now-invalid interface assertions and panic test.

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.

Remove deprecated http.CloseNotifier and replace with Request.Context().Done()

1 participant