Skip to content
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

inconsitent usage of context package #81

Closed
DennisRutjes opened this issue Jun 11, 2018 · 7 comments
Closed

inconsitent usage of context package #81

DennisRutjes opened this issue Jun 11, 2018 · 7 comments

Comments

@DennisRutjes
Copy link

Generated API uses golang.org/x/net/context".Context should use context".Context

github.com/envoyproxy/go-control-plane/pkg/server

../github.com/envoyproxy/go-control-plane/pkg/server/server.go:65:41: cannot use server literal (type *server) as type Server in return argument:
*server does not implement Server (wrong type for FetchClusters method)
have FetchClusters("context".Context, "github.com/envoyproxy/go-control-plane/envoy/api/v2".DiscoveryRequest) ("github.com/envoyproxy/go-control-plane/envoy/api/v2".DiscoveryResponse, error)
want FetchClusters("golang.org/x/net/context".Context, "github.com/envoyproxy/go-control-plane/envoy/api/v2".DiscoveryRequest) ("github.com/envoyproxy/go-control-plane/envoy/api/v2".DiscoveryResponse, error)

Compilation finished with exit code 2

@kyessenov
Copy link
Contributor

Can you please make sure you're using a recent version of Go? Type aliases were recently introduced to the language, and they get around this problem of legacy code using old struct names.

@DennisRutjes
Copy link
Author

mm I am using 1.9.7?

@kyessenov
Copy link
Contributor

Hmm, 1.9.7 should have type aliases. I saw this error before, but once I updated my dependencies it went away. I'll see if I can get rid of x/net/context. Some of it is coming from gRPC.

@DennisRutjes
Copy link
Author

thanks in advance!

@DennisRutjes
Copy link
Author

After I used go dep init for my project the issue was resolved!

so no urgency @kyessenov

@kyessenov
Copy link
Contributor

kyessenov commented Jun 11, 2018

Great. I'd prefer to keep using the old context package. There are some good arguments here gogo/protobuf#390.

@kyessenov
Copy link
Contributor

Let's wait a few months before changing the package (so all the underlying gogo/go issues get ironed out).

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

No branches or pull requests

2 participants