encoding/jsonpb: fix encoding of empty google.protobuf.Value

Description of message Value states:

`Value` represents a dynamically typed value which can be either null, a
number, a string, a boolean, a recursive struct value, or a list of values. A
producer of value is expected to set one of that variants, absence of any
variant indicates an error.

https://github.com/protocolbuffers/protobuf/blob/3.7.x/src/google/protobuf/struct.proto#L57-L60

Previous implementation was following C++ lib behavior.

Change-Id: Id51792e2fc8cc465a05a978e63410d3b6802b522
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/168901
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
diff --git a/encoding/jsonpb/encode_test.go b/encoding/jsonpb/encode_test.go
index 74dd570..d6a2e62 100644
--- a/encoding/jsonpb/encode_test.go
+++ b/encoding/jsonpb/encode_test.go
@@ -1008,15 +1008,15 @@
 		input: &knownpb.Empty{},
 		want:  `{}`,
 	}, {
-		desc:  "Value empty",
-		input: &knownpb.Value{},
-		want:  ``,
+		desc:    "Value empty",
+		input:   &knownpb.Value{},
+		wantErr: true,
 	}, {
 		desc: "Value empty field",
 		input: &pb2.KnownTypes{
 			OptValue: &knownpb.Value{},
 		},
-		want: `{}`,
+		wantErr: true,
 	}, {
 		desc:  "Value contains NullValue",
 		input: &knownpb.Value{Kind: &knownpb.Value_NullValue{}},
@@ -1531,7 +1531,7 @@
 		},
 		input: func() proto.Message {
 			m := &knownpb.Value{}
-			b, err := proto.MarshalOptions{Deterministic: true}.Marshal(m)
+			b, err := proto.Marshal(m)
 			if err != nil {
 				t.Fatalf("error in binary marshaling message for Any.value: %v", err)
 			}
@@ -1540,9 +1540,7 @@
 				Value:   b,
 			}
 		}(),
-		want: `{
-  "@type": "type.googleapis.com/google.protobuf.Value"
-}`,
+		wantErr: true,
 	}, {
 		desc: "Any with Duration",
 		mo: jsonpb.MarshalOptions{
@@ -1641,7 +1639,9 @@
 					{Kind: &knownpb.Value_ListValue{}},
 				},
 			},
-			OptValue: &knownpb.Value{},
+			OptValue: &knownpb.Value{
+				Kind: &knownpb.Value_StringValue{"world"},
+			},
 			OptEmpty: &knownpb.Empty{},
 			OptAny: &knownpb.Any{
 				TypeUrl: "google.protobuf.Empty",
@@ -1671,6 +1671,7 @@
     {},
     []
   ],
+  "optValue": "world",
   "optEmpty": {},
   "optAny": {
     "@type": "google.protobuf.Empty"