encoding/protobuf: don't encode default values for enums
As the fields are now optional, setting a default
does not make a whole ton of sense.
Change-Id: I10f78a41a17f027505a4b338059c00b04c4dc758
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/3661
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: Jason Wang <jasonwzm@google.com>
diff --git a/encoding/protobuf/parse.go b/encoding/protobuf/parse.go
index bfde74c..e70601c 100644
--- a/encoding/protobuf/parse.go
+++ b/encoding/protobuf/parse.go
@@ -636,12 +636,7 @@
var e ast.Expr = value
// Make the first value the default value.
- if i == 0 {
- e = value
- if numEnums > 1 {
- e = &ast.UnaryExpr{OpPos: newline, Op: token.MUL, X: value}
- }
- } else {
+ if i > 0 {
value.ValuePos = newline
}
addComments(e, i, y.Comment, nil)