ruiaylin / goprotobuf

Automatically exported from code.google.com/p/goprotobuf
Other
0 stars 0 forks source link

Why does proto.Int() return *int32 not *int ? #54

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
As *Summary* mentioned.

Original issue reported on code.google.com by wds...@gmail.com on 11 Aug 2014 at 5:20

GoogleCodeExporter commented 9 years ago
Generated protobuf structs don't use the "int" type (which is variably 32-bit 
or 64-bit in size). The proto.Int helper is there to avoid a call-site cast to 
int32 in a common case; proto.Int(x) is equivalent to proto.Int32(int32(x)).

Original comment by dsymo...@golang.org on 11 Aug 2014 at 5:22

GoogleCodeExporter commented 9 years ago
OK.

I thought it is an easy way to get a pointer value of some type before,
so...

Forgive my poor english.

2014-08-11 13:22 GMT+08:00 <goprotobuf@googlecode.com>:

-- 
Best Wishes
Clark Guan
=====================================
Android Platform Software Engineer
Country:China
Language:Chinese
City:Beijing
Mobile: +86 13439630106
MSN: wdsgyj@gmail.com
Email: wdsgyj@gmail.com

Original comment by wds...@gmail.com on 12 Aug 2014 at 4:33