goprotobuf: Use already-allocated nested messages if they exist.

This maintains the semantics that unmarshaling the concatenation of two
encoded messages is equivalent to merging those messages.

R=r
CC=golang-dev
https://codereview.appspot.com/10409046
goprotobuf: Make edge-case int32 encoding more compact, and the same as C++.

Fixes issue 39.

R=r
CC=golang-dev
https://codereview.appspot.com/10461043
goprotobuf: Fix Size accounting of packed fields.

Fixes issue 40.

R=crawshaw
CC=golang-dev
https://codereview.appspot.com/10477043
goprotobuf: Use p.isUnmarshaler consistently in decode.go.

Fixes issue 41.

R=crawshaw, r
CC=golang-dev
https://codereview.appspot.com/10474043
goprotobuf: fix integer overflows.

1) It's possible to panic the decoder by overflowing a length check.

2) (minor) the decoder was silently truncating varints that were larger than 64 bits. This isn't strictly a problem, but it could lead to a situation where a different decoder could decode a given message differently. Thus, if the message was vetted by one decoder and processed by another, an attacker could exploit this difference.

R=dsymonds
CC=golang-dev
https://codereview.appspot.com/11094044

Committer: David Symonds <dsymonds@golang.org>
goprotobuf: Fix SetDefaults to recur into repeated submessages.

R=r
CC=golang-dev
https://codereview.appspot.com/11255043
goprotobuf: Switch to using protobuf-2.5.0 as the baseline.

Regenerating descriptor.pb.go also lays the path for using SourceCodeInfo in the code generator.

R=r
CC=golang-dev
https://codereview.appspot.com/11893043
goprotobuf: Present comments in .proto files in the generated .pb.go.

This doesn't use every comment, but just the ones that I thought
would be most useful to someone reading the generated code, namely
those attached to these things:
        - messages
        - message fields
        - enums
        - enum values

R=r
CC=golang-dev
https://codereview.appspot.com/11889044
goprotobuf: Make UnmarshalText reset the message before unmarshaling.

This is the expected behaviour, and matches Unmarshal.

R=r
CC=golang-dev
https://codereview.appspot.com/12449043
goprotobuf: Fix handling of publicly imported enum types.

R=r
CC=golang-dev
https://codereview.appspot.com/12436045
goprotobuf: Simplify helper functions (Int32, etc.).

R=r
CC=golang-dev
https://codereview.appspot.com/12644043
goprotobuf: Fix documentation of minor edge case in CamelCase.

Fixes issue 42.

R=r
CC=golang-dev
https://codereview.appspot.com/12767050