Using kratos proto server to generate server stub, it doesn't recognize google.protobuf.empty
What you expected to happen:
google.protobuf.Empty to be correctly recognized and use empty.pb instead.
How to reproduce it (as minimally and precisely as possible):
Run -- kratos new helloworld
Modify api/helloworld/v1/greeter.proto to above
Remove internal/service/greeter.go and run kratos proto server ./api/helloworld/v1/greeter.proto
Anything else we need to know?:
It was previously working, perhaps my local environment messed up some configs with kratos.
Environment:
Kratos version (use kratos -v): kratos version v2.6.2
Go version (use go version): go version go1.20.3 linux/amd64
OS (e.g: cat /etc/os-release): Debian GNU/Linux 12 (bookworm)
How did you solve this problem? In my case, kratos proto server generated service.go and import incorrectly: &pb.google_protobuf_Empty{}, pb is specified in proto option go_package = "pb"
What happened:
Using
kratos proto server
to generate server stub, it doesn't recognize google.protobuf.emptyWhat you expected to happen:
google.protobuf.Empty
to be correctly recognized and useempty.pb
instead.How to reproduce it (as minimally and precisely as possible):
Run -- kratos new helloworld Modify api/helloworld/v1/greeter.proto to above Remove internal/service/greeter.go and run
kratos proto server ./api/helloworld/v1/greeter.proto
Anything else we need to know?:
It was previously working, perhaps my local environment messed up some configs with kratos.
Environment:
kratos -v
): kratos version v2.6.2go version
): go version go1.20.3 linux/amd64cat /etc/os-release
): Debian GNU/Linux 12 (bookworm)