encoding/protobuf: don't mark a single enum value as default
Issue #5
Change-Id: Icb6e8b5c6c490ea7123e554a9fb86a2b8d8ba624
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/2373
Reviewed-by: Marcel van Lohuizen <mpvl@golang.org>
diff --git a/encoding/protobuf/testdata/client_config.proto.out.cue b/encoding/protobuf/testdata/client_config.proto.out.cue
index efa1f40..66ec87a 100644
--- a/encoding/protobuf/testdata/client_config.proto.out.cue
+++ b/encoding/protobuf/testdata/client_config.proto.out.cue
@@ -42,19 +42,13 @@
maxRetryWait?: time.Duration @protobuf(4,type=google.protobuf.Duration,name=max_retry_wait)
}
-// Describes the policy.
+// Example of single-value enum.
NetworkFailPolicy_FailPolicy:
// If network connection fails, request is allowed and delivered to the
// service.
- *"FAIL_OPEN" |
+ "FAIL_OPEN"
- // If network connection fails, request is rejected.
- "FAIL_CLOSE"
-
-NetworkFailPolicy_FailPolicy_value: {
- FAIL_OPEN: 0
- FAIL_CLOSE: 1
-}
+NetworkFailPolicy_FailPolicy_value FAIL_OPEN: 0
// Defines the per-service client configuration.
ServiceConfig: {
diff --git a/encoding/protobuf/testdata/istio.io/api/mixer/v1/config/client/client_config.proto b/encoding/protobuf/testdata/istio.io/api/mixer/v1/config/client/client_config.proto
index a229699..c540745 100644
--- a/encoding/protobuf/testdata/istio.io/api/mixer/v1/config/client/client_config.proto
+++ b/encoding/protobuf/testdata/istio.io/api/mixer/v1/config/client/client_config.proto
@@ -37,14 +37,12 @@
// Specifies the behavior when the client is unable to connect to Mixer.
message NetworkFailPolicy {
- // Describes the policy.
+
+ // Example of single-value enum.
enum FailPolicy {
// If network connection fails, request is allowed and delivered to the
// service.
FAIL_OPEN = 0;
-
- // If network connection fails, request is rejected.
- FAIL_CLOSE = 1;
}
// Specifies the behavior when the client is unable to connect to Mixer.
diff --git a/encoding/protobuf/testdata/istio.io/api/mixer/v1/config/client/client_config_proto_gen.cue b/encoding/protobuf/testdata/istio.io/api/mixer/v1/config/client/client_config_proto_gen.cue
index 2f4bf64..8471bc5 100644
--- a/encoding/protobuf/testdata/istio.io/api/mixer/v1/config/client/client_config_proto_gen.cue
+++ b/encoding/protobuf/testdata/istio.io/api/mixer/v1/config/client/client_config_proto_gen.cue
@@ -41,19 +41,13 @@
maxRetryWait?: time.Duration @protobuf(4,type=google.protobuf.Duration,name=max_retry_wait)
}
-// Describes the policy.
+// Example of single-value enum.
NetworkFailPolicy_FailPolicy:
// If network connection fails, request is allowed and delivered to the
// service.
- *"FAIL_OPEN" |
+ "FAIL_OPEN"
- // If network connection fails, request is rejected.
- "FAIL_CLOSE"
-
-NetworkFailPolicy_FailPolicy_value: {
- "FAIL_OPEN": 0
- "FAIL_CLOSE": 1
-}
+NetworkFailPolicy_FailPolicy_value "FAIL_OPEN": 0
// Defines the per-service client configuration.
ServiceConfig: {