Skip to content

Bump golang.org/x/net to go1.10 release commit #36894

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

Merged
merged 1 commit into from
Apr 19, 2018

Conversation

cpuguy83
Copy link
Member

The primary need for this is x/net/context now is just a type alias to
the stdlib context package.
This makes issues with conflicts between "golang.org/x/net/context" and
the stdib "context" go away (primarily a concern in interface
definitions/implementations).

Came across this working on #36688

The primary need for this is x/net/context now is just a type alias to
the stdlib context package.
This makes issues with conflicts between "golang.org/x/net/context" and
the stdib "context" go away (primarily a concern in interface
definitions/implementations).

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
@codecov
Copy link

codecov bot commented Apr 18, 2018

Codecov Report

Merging #36894 into master will decrease coverage by 0.32%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master   #36894      +/-   ##
==========================================
- Coverage   35.26%   34.94%   -0.33%     
==========================================
  Files         614      614              
  Lines       45698    45698              
==========================================
- Hits        16117    15969     -148     
- Misses      27453    27633     +180     
+ Partials     2128     2096      -32

@tonistiigi
Copy link
Member

LGTM

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah thaJeztah merged commit f0b2f93 into moby:master Apr 19, 2018
@cpuguy83 cpuguy83 deleted the bump_x_net branch April 19, 2018 01:11
@kolyshkin
Copy link
Contributor

I wonder is anything bad can happen if we do s/"golang.org/x/net/context"/"context"/ across the codebase?

@thaJeztah
Copy link
Member

I think there's still dependencies that use the /x/net/context, but we can check if that changed

@cpuguy83
Copy link
Member Author

We should be able to change it since in the new x/net/context, context.Context just a type alias.

The reason it was an issue before is because there were two different implementations of Context, one in the stdlib and one in x/net/context... so with this interface...

import "golang.org/x/net/context"
type Fooer interface {
    Foo(ctx context.Context)
}

You can't provide an implementation that looks like this:

import "context"

type myFoo struct {}

func(myFoo) Foo(ctx context.Context) {}

Until this bumped commit which takes advantage of https://github.com/golang/proposal/blob/master/design/18130-type-alias.md

Where context in golang.org/x/net is no longer defining a new interface but rather just doing:

"import context"

type Context = context.Context

@thaJeztah
Copy link
Member

In that case, I'd say we should definitely look into using "context" instead 🤗

@kolyshkin
Copy link
Contributor

OK, let's see if this works: #36904

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

Successfully merging this pull request may close these issues.

5 participants