Radar · Go · Archive · Week 37 · Sep 8 – 14, 2025
x/net/context deprecation proposal
Worth knowingtooling
- What changed
- The Go team has accepted a proposal to mark the
golang.org/x/net/contextpackage as deprecated, so linters will emit warnings when it is used. - Production impact
- The source does not say.
- Try it
- Run
go veton a project that importsgolang.org/x/net/contextand observe the deprecation warning. - Source
- github.com/golang/go/issues/49506
Understand it, then run it
Run it now
// This program demonstrates that the standard library's `context` package
// is the correct import to use. The deprecated `golang.org/x/net/context`
// package is no longer imported, so no deprecation warning is emitted.
// The program prints the concrete type of the background context value.
package main
import (
"context"
"fmt"
)
func main() {
// Obtain the background context from the standard library.
c := context.Background()
// Print the concrete type of the context value.
fmt.Printf("Context type: %T\n", c)
}
What it printed when we ran it on Go 1.27.1
Context type: context.backgroundCtx
Run sends this program (for Solidity, the contract and its tests) to our own sandbox, where it is compiled and run once, with no network, and what it printed or the test report comes back here. Nothing is kept. Runs are counted per visitor for the day so everyone gets a turn; the details are on the legal page.
Written by gpt-oss-20b from the linked source · claims checked against the sources · archive, not individually reviewed