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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate away from importing github.com/golang/protobuf/{descriptor,proto} in generated code (similar to #1260). #1608

Closed
marthjod opened this issue Aug 21, 2020 · 2 comments

Comments

@marthjod
Copy link

馃悰 Bug Report

Generated gateway code imports github.com/golang/protobuf/{descriptor,proto} which is deprecated according to staticcheck. We're stuck for now on v1.14.5, but afaics there's no fix in newer versions either?

To Reproduce

Run staticcheck on generated gateway code which contains

// rpc/gateway/rpc.pb.gw.go
import (
    "github.com/golang/protobuf/descriptor"
    "github.com/golang/protobuf/proto"
)

Expected behavior

No output.

Actual Behavior

rpc/gateway/rpc.pb.gw.go:16:2: package github.com/golang/protobuf/descriptor is deprecated: See the "google.golang.org/protobuf/reflect/protoreflect" package for how to obtain an EnumDescriptor or MessageDescriptor in order to programatically interact with the protobuf type system.  (SA1019)
rpc/gateway/rpc.pb.gw.go:17:2: package github.com/golang/protobuf/proto is deprecated: Use the "google.golang.org/protobuf/proto" package instead.  (SA1019)
rpc/gateway/rpc.pb.gw.go:32:9: descriptor.ForMessage is deprecated: Not all concrete message types satisfy the Message interface. Use MessageDescriptorProto instead. If possible, the calling code should be rewritten to use protobuf reflection instead. See package "google.golang.org/protobuf/reflect/protoreflect" for details.  (SA1019)

Your Environment

v1.14.5, Ubuntu 20.04.1 LTS

@johanbrandhorst
Copy link
Collaborator

Hi @marthjod, thanks for your issue. The grpc-gateway has gone through a large rewrite to support the new version of the Go protobuf stack. Please see the note on the latest release about v2: https://github.com/grpc-ecosystem/grpc-gateway/releases/tag/v1.14.7.

@marthjod
Copy link
Author

Thanks for the quick reply and the rewrite work. We'll try to update accordingly.

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

No branches or pull requests

2 participants