Skip to content

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

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

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
Copy Markdown

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.

@JiwaniZakir
Copy link
Copy Markdown
Author

Closing this PR as it hasn't received maintainer review. Happy to resubmit if there's interest.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (3dc1cd6) to head (250c29c).
⚠️ Report is 275 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #4588       +/-   ##
==========================================
- Coverage   99.21%       0   -99.22%     
==========================================
  Files          42       0       -42     
  Lines        3182       0     -3182     
==========================================
- Hits         3157       0     -3157     
+ Misses         17       0       -17     
+ Partials        8       0        -8     
Flag Coverage Δ
?
go-1.18 ?
go-1.19 ?
go-1.20 ?
go-1.21 ?
macos-latest ?
ubuntu-latest ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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