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

Can shurcooL/go/ctxhttp dependency be removed? #2

Closed
gmlewis opened this Issue Aug 9, 2017 · 4 comments

Comments

2 participants
@gmlewis

gmlewis commented Aug 9, 2017

Re:

"github.com/shurcooL/go/ctxhttp"

the ctxhttp package is being imported, which then refers to https://go-review.googlesource.com/c/24620
which has been merged.
Is it possible to remove the dependency now?

@dmitshur

This comment has been minimized.

Member

dmitshur commented Aug 9, 2017

Hi Glenn,

Thanks for checking in on this. To be clear, the ctxhttp package comment says:

It's a copy of "golang.org/x/net/context/ctxhttp" with pre-1.7 support dropped, and "golang.org/x/net/context" import replaced with "context". It exists temporarily until "golang.org/x/net/context/ctxhttp" is updated, which will happen "in a couple releases" according to https://golang.org/cl/24620.

Specifically, it exists until golang.org/x/net/context/ctxhttp is updated to use context instead of the obsolete golang.org/x/net/context. It is not waiting on CL 24620 to be merged—that happened a long time ago. I referenced that CL because its the source of information that the golang.org/x/net/context/ctxhttp update to use context will happen "in a couple releases".

Perhaps I should've been more specific there and pointed to the message itself:

https://go-review.googlesource.com/c/24620#message-a0eec577b9152b699a15e9c50c8615654fb3191b

That hasn't happened yet, so I can't quite do this. Otherwise, it would result in both context and golang.org/x/net/context packages being imported (indirectly), which would be suboptimal.

Now that Go 1.9 final is almost released, perhaps it's very soon that golang.org/x/net/context/ctxhttp can be updated and my copy will no longer need to exist.

@dmitshur

This comment has been minimized.

Member

dmitshur commented Aug 9, 2017

I've filed golang/go#21358 to find out what the status of the upstream ctxhttp is, and when it can be updated to use the modern context import.

@dmitshur

This comment has been minimized.

Member

dmitshur commented Aug 9, 2017

Until that issue is resolved, I'll just note that the github.com/shurcooL/go/ctxhttp package is very simple conceptually. Its source is 100% identical to golang.org/x/net/context/ctxhttp, except the pre-1.7 support is dropped and "golang.org/x/net/context" import is replaced with "context".

Compare for yourself:

@dmitshur

This comment has been minimized.

Member

dmitshur commented Nov 14, 2018

Issue golang/go#21358 has been resolved today, so I can finally resolve this issue! 🎉 /cc @gmlewis @bradfitz

@dmitshur dmitshur closed this in 16b8864 Nov 14, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment