Commit Graph

5 Commits

Author SHA1 Message Date
Damien Neil
e89e6244e0 all: change module to google.golang.org/protobuf
Temporarily remove go.mod, since we can't generate an accurate one until
the corresponding v1 change is submitted.

Change-Id: I1e1ad97f2b455e33f61ffaeb8676289795e47e72
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/177000
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
2019-05-14 17:28:29 +00:00
Herbie Ong
09b28a97f7 encoding/textpb: clean-up code and fix error handling inside closures
In marshalMap, replace Map.Range and sortMap with
internal/mapsort.Range. Also, make sure to capture fatal error properly
for return.

In appendExtensions, capture fatal error properly for return. Added a
testcase that shows this was a bug.

In unmarshalAny, remove unnecessary checks and use internal/fieldnum for
Any's field numbers.

Change-Id: Id8574d5b4eb820ad961f6ad5e886f8ae2e9b90f0
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/170627
Reviewed-by: Damien Neil <dneil@google.com>
2019-04-04 00:03:54 +00:00
Herbie Ong
300b9fe4da encoding/jsonpb: fix unmarshaling of NullValue field
A JSON "null" field should set the NullValue enum field because
NullValue has the custom encoding format of "null".

Change-Id: I2bfa0900de64d7e2874f7c6db04b1cbc0b61b904
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/170107
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
2019-04-02 04:50:03 +00:00
Herbie Ong
0b0f4036db encoding/jsonpb: add support for marshaling well-known types
Also, changed MarshalOptions.Compact to Indent for consistency with v1
and to make compact as the default.

Change-Id: Id08aaa5ca5656f18e7925d2eabc0b6b055b1cebb
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/168352
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
2019-03-20 23:30:00 +00:00
Herbie Ong
8170d69313 encoding/textpb: move test protos under encoding/testprotos
These test proto definitions will be reused for encoding/jsonpb package
and hence move these one directory up.

Also, add and simplify some tests.

Change-Id: I5297546fd9b853a7fd3e72dfab2fdc7237332c9c
Reviewed-on: https://go-review.googlesource.com/c/162537
Reviewed-by: Damien Neil <dneil@google.com>
2019-02-14 01:03:44 +00:00