diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-08-30 11:47:47 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-08-30 12:04:25 +0300 |
commit | d52975efc2b4978aef138fb606b81347b82d366c (patch) | |
tree | 70279aa8b53362fccdfc1dbaba02aea77e4448bf /proto/go/internal/linter/lint.go | |
parent | 40fae4205d3ad62ca9341620146486bee8d31b28 (diff) |
protobuf: Migrate to use new descriptorpb package
The golang/protobuf dependency is deprecated in favor of
google.golang.org/protobuf. Migrate our usage of the descriptor package
to use the new descriptorpb package instead.
Diffstat (limited to 'proto/go/internal/linter/lint.go')
-rw-r--r-- | proto/go/internal/linter/lint.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/proto/go/internal/linter/lint.go b/proto/go/internal/linter/lint.go index f7d0fd43c..95a97e2d8 100644 --- a/proto/go/internal/linter/lint.go +++ b/proto/go/internal/linter/lint.go @@ -4,11 +4,11 @@ import ( "errors" "fmt" - "github.com/golang/protobuf/protoc-gen-go/descriptor" plugin "github.com/golang/protobuf/protoc-gen-go/plugin" "gitlab.com/gitlab-org/gitaly/v14/internal/protoutil" "gitlab.com/gitlab-org/gitaly/v14/proto/go/gitalypb" "google.golang.org/protobuf/reflect/protoregistry" + "google.golang.org/protobuf/types/descriptorpb" ) // ensureMethodOpType will ensure that method includes the op_type option. @@ -17,7 +17,7 @@ import ( // rpc ExampleMethod(ExampleMethodRequest) returns (ExampleMethodResponse) { // option (op_type).op = ACCESSOR; // } -func ensureMethodOpType(fileDesc *descriptor.FileDescriptorProto, m *descriptor.MethodDescriptorProto, req *plugin.CodeGeneratorRequest) error { +func ensureMethodOpType(fileDesc *descriptorpb.FileDescriptorProto, m *descriptorpb.MethodDescriptorProto, req *plugin.CodeGeneratorRequest) error { opMsg, err := protoutil.GetOpExtension(m) if err != nil { if errors.Is(err, protoregistry.NotFound) { @@ -51,7 +51,7 @@ func ensureMethodOpType(fileDesc *descriptor.FileDescriptorProto, m *descriptor. } } -func validateMethod(file *descriptor.FileDescriptorProto, service *descriptor.ServiceDescriptorProto, method *descriptor.MethodDescriptorProto, req *plugin.CodeGeneratorRequest) error { +func validateMethod(file *descriptorpb.FileDescriptorProto, service *descriptorpb.ServiceDescriptorProto, method *descriptorpb.MethodDescriptorProto, req *plugin.CodeGeneratorRequest) error { if intercepted, err := protoutil.IsInterceptedService(service); err != nil { return fmt.Errorf("is intercepted service: %w", err) } else if intercepted { @@ -72,7 +72,7 @@ func validateMethod(file *descriptor.FileDescriptorProto, service *descriptor.Se // LintFile ensures the file described meets Gitaly required processes. // Currently, this is limited to validating if request messages contain // a mandatory operation code. -func LintFile(file *descriptor.FileDescriptorProto, req *plugin.CodeGeneratorRequest) []error { +func LintFile(file *descriptorpb.FileDescriptorProto, req *plugin.CodeGeneratorRequest) []error { var errs []error for _, service := range file.GetService() { |