This site is being rebuilt and some pages are out of date. For current details, write to [email protected]. This notice goes away when the rebuild is done.

No analytics unless you allow it, no tracking. This site keeps in your browser the language you pick, the theme, its colour, which site you chose, the currency on the pricing page and that you closed this notice; signing in adds session cookies. The legal page has the details.

Sign in

Radar · Go · Archive · Week 29 · Jul 13 – 19, 2026

net/http: drop support for Transport.CancelRequest

Worth knowingstdlib

What changed
The deprecated Transport.CancelRequest function is removed.
Production impact
The source does not say.
Try it
Build a small HTTP client and verify that Transport.CancelRequest is no longer available.
Source
github.com/golang/go/issues/79040

Understand it, then run it

The Transport.CancelRequest function was a way to stop an HTTP request that was already in progress. It was marked as deprecated in Go 1.6 and has been unused for many years. In the upcoming Go 1.28 release the function is removed entirely. If you see code that calls Transport.CancelRequest, it will no longer compile. The modern way to cancel a request is to use a context with NewRequestWithContext, which is the only supported cancellation mechanism.

Written by gpt-oss-20b from the linked source · claims checked against the sources · archive, not individually reviewed