Open ghost opened 3 months ago
Can you provide a small reproducible example? I'll take a look.
Sure
Create example.proto with the following contents:
syntax = "proto3";
option go_package = "example.com/example";
service ExampleService {
rpc ExampleRPC(ExampleMessage) returns (ExampleMessage);
}
message ExampleMessage {}
Run the following:
$ PROTO_PATCH_DEBUG_LOGGING=true protoc -I . --go-patch_out=plugin=connect-go:. example.proto
Scan proto: example.proto
Generating: example.proto
Go package: example "example.com/example"
Parse Go: example.com/example/exampleconnect/example.connect.go
Error: unknown package: exampleconnect
--go-patch_out: protoc-gen-go-patch: Plugin failed with status code 1.
Note of course you will need protoc-gen-connect-go which can be installed with:
go install connectrpc.com/connect/cmd/protoc-gen-connect-go@latest
Enabling debug logging shows the following error:
The connect go generator forces the connect rpc stub generation to be in a sub-package to avoid namespace conflicts which I imagine is why it fails.