Scalar值类型
标量消息类型,该表显示了.proto文件中指定的类型,以及自动生成的类中相应的类型:
.proto Type | Java Type | Go Type |
---|---|---|
double | double | *float64 |
float | float | *float32 |
int32 | int | *int32 |
int64 | long | *int64 |
uint32 | int | *uint32 |
uint64 | long | *uint64 |
sint32 | int | *int32 |
sint64 | int | *int64 |
fixed32 | int | *uint32 |
fixed64 | long | *uint64 |
sfixed32 | int | *int32 |
sfixed64 | long | *int64 |
bool | boolean | *bool |
string | String | *string |
bytes | ByteString | []byte |