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

Compilation error in generated code due to case #807

Closed
davideimola opened this issue Jan 8, 2025 · 1 comment · Fixed by #808
Closed

Compilation error in generated code due to case #807

davideimola opened this issue Jan 8, 2025 · 1 comment · Fixed by #808
Labels
bug Something isn't working

Comments

@davideimola
Copy link

Describe the bug

When I generate the code with the v1.18.0 I encountered a generation error.
My service is called ExampleV1beta1, but when I generate the code with buf I have found an error as the generated code is

exampleV1beta1Methods :=  example.File_redcarbon_example_example_proto.Services().ByName("ExampleV1beta1").Methods()
	return &exampleV1Beta1Client{
		getExample: connect.NewClient[example.GetExampleRequest, example.GetExampleResponse](
			httpClient,
			baseURL+ExampleV1Beta1GetExampleProcedure,
			connect.WithSchema(exampleV1Beta1Methods.ByName("GetExample")),
			connect.WithClientOptions(opts...),
		),
	}

As you can see the variable is exampleV1beta1Methods but is used inside of the function as exampleV1Beta1Methods.

To Reproduce

I have used the following buf.gen.yaml

version: v1
managed:
  enabled: true
  go_package_prefix:
    default: pkg.redcarbon.ai/proto
plugins:
  - plugin: buf.build/protocolbuffers/go:v1.36.0
    out: proto
    opt: paths=source_relative
  - plugin: buf.build/connectrpc/go:v1.18.0
    out: proto
    opt: paths=source_relative

the service is

syntax = "proto3";

package example;

service ExampleV1beta1 {
  rpc GetExample(GetExampleRequest) returns (GetExampleResponse) {}
}

message GetExampleRequest {
  string example_id = 1;
}

message GetExampleResponse {
  string example_id = 1;
  string example_name = 2;
}

Environment (please complete the following information):

  • connect-go version or commit: (for example, v0.1.0 or 5bfc7a1b440ebffdc952d813332e3617ca611395) v1.18.0
  • go version: (for example, go version go1.18.3 darwin/amd64) go version go1.23.1 darwin/arm64
@emcfarlane
Copy link
Contributor

@davideimola thanks for this issue. I've made a fix in #808 and will look at creating a new patch release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants