-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proposal: x/net/context: deprecate package or symbols in package, and potentially tag/delete #49506
Comments
The |
There's also a context fix available to aid with the migration, so
Deprecations (and deletions) need an accepted proposal. We can repurpose this issue. |
Change https://go.dev/cl/650155 mentions this issue: |
Change https://go.dev/cl/650156 mentions this issue: |
The go directive is now at 1.23.0, so the go1.7 and go1.9 build constraints are guaranteed to always be satisfied, and their inverse will never be satisfied. Delete all the dead code and merge everything that's left in a single context.go file. Also update docs to match the upstream context package. For golang/go#49506. Change-Id: I317550767838a93af2c2d3dbc7b61f2e37e6fe1c Reviewed-on: https://go-review.googlesource.com/c/net/+/650155 Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Damien Neil <[email protected]> Auto-Submit: Dmitri Shuralyov <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
This is motivated by a few reasons. One, the upstream package has more examples, and no one should be looking at this old package to learn how to use it. Seeing an example might make it seem like the scope of the documentation here is to provide examples, and that there aren't many of them. Instead of trying to add more examples or maintain the current one by porting the de-flake enhancement from CL 460999, delete the only example here. Second, running 'go fix ./...' causes the 'context' fix to rewrite the import path of the example from "golang.org/x/net/context" to "context". That is a false positive in the fix, and I would've liked it fix the fix, but it only has the AST information at this time, not type info, so the import path isn't currently available to the check. That means it can't know when it's running on the golang.org/x/net/context package, which is the one place it should skip the rewrite. It seems simpler to just delete the example, and then it becomes possible to use 'go fix ./...' safely on the entire x/net module. For golang/go#49506. Change-Id: I97eba33ca2e1f2960aef8340d8b561639a26ee48 Reviewed-on: https://go-review.googlesource.com/c/net/+/650156 Reviewed-by: Ian Lance Taylor <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> Reviewed-by: Damien Neil <[email protected]> Auto-Submit: Dmitri Shuralyov <[email protected]>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Accidentally used golang.org/x/net/context
What did you expect to see?
A deprecation warning caught by our linter. Basically I think we should mark the package (or symbols in the package) deprecated so that linters would notice and automatically suggest people switch to
context
.What did you see instead?
Nothing.
The text was updated successfully, but these errors were encountered: