Skip to content

Compilation error in generated code due to case #807

@davideimola

Description

@davideimola

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions