diff --git a/example/simple/client/main.go b/example/simple/client/main.go index 0a3db1e7..be26fb5f 100644 --- a/example/simple/client/main.go +++ b/example/simple/client/main.go @@ -186,5 +186,11 @@ func main() { if r.Message != "72057594037927936 18446744073709551615" { log.Fatalf("failed to get valid message: %v", r.Message) } + if r.Vint64 != 72057594037927936 { + log.Fatalf("expected: 72057594037927936, received: %d", r.Vint64) + } + if r.Vuint64 != 18446744073709551615 { + log.Fatalf("expected: 18446744073709551615, received: %d", r.Vuint64) + } log.Printf("Greeting: %s (return code %d)", r.Message, r.ReturnCode) } diff --git a/example/simple/simple.proto b/example/simple/simple.proto index c8856d9e..cff540c1 100644 --- a/example/simple/simple.proto +++ b/example/simple/simple.proto @@ -21,4 +21,6 @@ message Request { message Reply { string message = 1; int32 return_code = 2; + int64 vint64 = 3; + uint64 vuint64 = 4; } \ No newline at end of file diff --git a/example/simple/stub/uint64_int64.yml b/example/simple/stub/uint64_int64.yml index bd798ae6..dac2d042 100644 --- a/example/simple/stub/uint64_int64.yml +++ b/example/simple/stub/uint64_int64.yml @@ -9,4 +9,8 @@ vuint64: 18446744073709551615 output: data: - message: "72057594037927936 18446744073709551615" \ No newline at end of file + message: "72057594037927936 18446744073709551615" + # {"high":72057594037927936,"low":0} + vint64: 72057594037927936 + # {"high":18446744073709551615,"low":18446744073709551615} + vuint64: 18446744073709551615 diff --git a/protogen/example/simple/simple.pb.go b/protogen/example/simple/simple.pb.go index d6073ef4..d83c90e8 100644 --- a/protogen/example/simple/simple.pb.go +++ b/protogen/example/simple/simple.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.30.0 -// protoc v4.23.4 +// protoc v4.24.3 // source: simple.proto package simple @@ -92,6 +92,8 @@ type Reply struct { Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` ReturnCode int32 `protobuf:"varint,2,opt,name=return_code,json=returnCode,proto3" json:"return_code,omitempty"` + Vint64 int64 `protobuf:"varint,3,opt,name=vint64,proto3" json:"vint64,omitempty"` + Vuint64 uint64 `protobuf:"varint,4,opt,name=vuint64,proto3" json:"vuint64,omitempty"` } func (x *Reply) Reset() { @@ -140,6 +142,20 @@ func (x *Reply) GetReturnCode() int32 { return 0 } +func (x *Reply) GetVint64() int64 { + if x != nil { + return x.Vint64 + } + return 0 +} + +func (x *Reply) GetVuint64() uint64 { + if x != nil { + return x.Vuint64 + } + return 0 +} + var File_simple_proto protoreflect.FileDescriptor var file_simple_proto_rawDesc = []byte{ @@ -149,18 +165,21 @@ var file_simple_proto_rawDesc = []byte{ 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x76, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x76, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, - 0x76, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x22, 0x42, 0x0a, 0x05, 0x52, 0x65, 0x70, 0x6c, 0x79, + 0x76, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x22, 0x74, 0x0a, 0x05, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x0a, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x32, 0x36, 0x0a, 0x08, 0x47, - 0x72, 0x69, 0x70, 0x6d, 0x6f, 0x63, 0x6b, 0x12, 0x2a, 0x0a, 0x08, 0x53, 0x61, 0x79, 0x48, 0x65, - 0x6c, 0x6c, 0x6f, 0x12, 0x0f, 0x2e, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x52, 0x65, - 0x70, 0x6c, 0x79, 0x42, 0x2a, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x62, 0x61, 0x76, 0x69, 0x78, 0x2f, 0x67, 0x72, 0x69, 0x70, 0x6d, 0x6f, 0x63, 0x6b, - 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x0a, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x76, + 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x76, 0x69, 0x6e, + 0x74, 0x36, 0x34, 0x12, 0x18, 0x0a, 0x07, 0x76, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x76, 0x75, 0x69, 0x6e, 0x74, 0x36, 0x34, 0x32, 0x36, 0x0a, + 0x08, 0x47, 0x72, 0x69, 0x70, 0x6d, 0x6f, 0x63, 0x6b, 0x12, 0x2a, 0x0a, 0x08, 0x53, 0x61, 0x79, + 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x12, 0x0f, 0x2e, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x2e, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0d, 0x2e, 0x73, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x2e, + 0x52, 0x65, 0x70, 0x6c, 0x79, 0x42, 0x2a, 0x5a, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, + 0x63, 0x6f, 0x6d, 0x2f, 0x62, 0x61, 0x76, 0x69, 0x78, 0x2f, 0x67, 0x72, 0x69, 0x70, 0x6d, 0x6f, + 0x63, 0x6b, 0x2f, 0x65, 0x78, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x2f, 0x73, 0x69, 0x6d, 0x70, 0x6c, + 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/protogen/example/simple/simple_grpc.pb.go b/protogen/example/simple/simple_grpc.pb.go index a431f6d4..8f457ad5 100644 --- a/protogen/example/simple/simple_grpc.pb.go +++ b/protogen/example/simple/simple_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.3.0 -// - protoc v4.23.4 +// - protoc v4.24.3 // source: simple.proto package simple