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

replace all uses of golang/protobuf/protobuf #3511

Closed
aimuz opened this issue Aug 18, 2023 · 1 comment · Fixed by #3516
Closed

replace all uses of golang/protobuf/protobuf #3511

aimuz opened this issue Aug 18, 2023 · 1 comment · Fixed by #3516

Comments

@aimuz
Copy link
Contributor

aimuz commented Aug 18, 2023

github.com/golang/protobuf has been marked as deprecated, and the dependency seems to be referenced in the current code.

I have noticed a pr that could not be fully replaced due to rules_go, and I was wondering if this work can now continue?

#1358

@johanbrandhorst

I think you should know better, I also found an unfinished business inside the code,thanks you

// AddErrorDefs Adds google.rpc.Status and google.protobuf.Any
// to registry (used for error-related API responses)
func AddErrorDefs(reg *descriptor.Registry) error {
	// load internal protos
	any, _ := legacydescriptor.MessageDescriptorProto(&anypb.Any{})
	any.SourceCodeInfo = new(descriptorpb.SourceCodeInfo)
	status, _ := legacydescriptor.MessageDescriptorProto(&statuspb.Status{})
	status.SourceCodeInfo = new(descriptorpb.SourceCodeInfo)
	// TODO(johanbrandhorst): Use new conversion later when possible
	// any := protodesc.ToFileDescriptorProto((&anypb.Any{}).ProtoReflect().Descriptor().ParentFile())
	// status := protodesc.ToFileDescriptorProto((&statuspb.Status{}).ProtoReflect().Descriptor().ParentFile())
	return reg.Load(&pluginpb.CodeGeneratorRequest{
		ProtoFile: []*descriptorpb.FileDescriptorProto{
			any,
			status,
		},
	})
}
@johanbrandhorst
Copy link
Collaborator

Yep it would be great to attempt this again now that most of the ecosystem has moved on.

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

Successfully merging a pull request may close this issue.

2 participants