Is it possible to change default model of proto3
from CamelCase to snake_case in grpc?
example :
file anyproto.proto
...
message Request {
bool RequestStatus = 1;
string RequestMessage = 2
}
...
now the protoc -I. --go_out=plugins=grpc:. anyproto.proto
command generate this model:
file : anyproto.pb.go
type Request struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
RequestStatus bool `protobuf:"varint,1,opt,name=requestStatus,proto3" json:"requestStatus,omitempty"`
RequestMessage string `protobuf:"bytes,2,opt,name=requestMessage,proto3" json:"requestMessage,omitempty"`
}
I want to change style of requestStatus
and requestMessage
to request_status
and request_message
is this what you are looking for?
https://developers.google.com/protocol-buffers/docs/style#message_and_field_names
Quoted from link: