cloudevents / sdk-go

Go SDK for CloudEvents
https://cloudevents.github.io/sdk-go/
Apache License 2.0
837 stars 223 forks source link

CloudEvent proto with wrong definition of go_package option #962

Open AFMiziara opened 1 year ago

AFMiziara commented 1 year ago

I am trying to import CloudEvent as a direct dependency in one of my gRPC services definitions and I am building the whole application with Bazel. I managed to import the proto itself, but then I got the following error:

bazel-out/darwin-fastbuild/bin/proto/xyz/abc/xxx/v1/xxxv1_go_proto_/github.com/xxx-io/go/proto/xxx/xyz/abc/v1/service.pb.go:10:5: could not import / (import path cannot be absolute path)

This is caused, because right now we have this definition of go_package option: https://github.com/cloudevents/sdk-go/blob/70abff67deec3c82098aca9beb391ee4d8ae0c67/binding/format/protobuf/v2/pb/cloudevent.proto#L5

When it should reflect the full import path of the generated Go code:

option go_package = "github.com/cloudevents/sdk-go/binding/format/protobuf/v2/pb"