commit | 5f47167600767f74140aab78bec4587170e59b73 | [log] [tgz] |
---|---|---|
author | Jason Wang <jasonwzm@google.com> | Fri Aug 23 09:59:46 2019 -0700 |
committer | Marcel van Lohuizen <mpvl@golang.org> | Fri Aug 23 18:24:35 2019 +0000 |
tree | e7966a7bb641a6fc538307c384a10f6228d2785b | |
parent | 90bca2f6a1db443b1e27f0174788a64bb98fd530 [diff] [blame] |
encoding/protobuf: make map field as not required by default in proto3 all fields are optional, thus making the map field optional as well. Change-Id: I5397adf6bfc990d6af248acef5bc4dcdf89c5cdd Reviewed-on: https://cue-review.googlesource.com/c/cue/+/2981 Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
diff --git a/encoding/protobuf/parse.go b/encoding/protobuf/parse.go index 6432fce..dc1a230 100644 --- a/encoding/protobuf/parse.go +++ b/encoding/protobuf/parse.go
@@ -545,6 +545,10 @@ o.parse(x.Options) p.addTag(f, o.tags) + if !o.required { + f.Optional = token.NoSpace.Pos() + } + case *proto.Enum: p.enum(x)